Westminster Village North, a nursing home and retirement community in Indianapolis, recently added 25 beds and two kitchens to speed food delivery to residents. It also redesigned patient rooms to ease wheelchair use and added Wi-Fi and flatscreen televisions.

"We have seen amazing changes and created a more home-like environment for our residents," said Shelley Rauch, executive director of the home.

The nursing home can afford these multimillion-dollar improvements partly because it has, for the past five years, been collecting significantly higher reimbursement rates from Medicaid, the state-federal health insurance program for the poor. About half of its residents are covered by the program.

In 2012, the nursing facility was leased to Hancock Regional Hospital, a county-owned hospital 15 miles away. The lease lets it take advantage of a wrinkle in Medicaid's complex funding formula that gives nursing homes owned or leased by city or county governments a funding boost. For Indiana, that translates to 30 percent more federal dollars per Medicaid resident. But that money is sent to the hospitals, which negotiate with the nursing homes on how to divide the funding.

Nearly 90 percent of the state's 554 nursing homes have been leased or sold to county hospitals, state records show.

Even though Indiana's nursing home population has remained steady at about 39,000 people over the past five years, Medicaid spending for the homes has increased by $900 million, in large part because of the extra federal dollars, according to state data. Total spending on Indiana nursing homes was $2.2 billion in 2016.

The funding enhancements were pioneered in Indiana, but hospitals in several other states, including Pennsylvania and Michigan, have also used the process. Advocates say it has been a key factor in helping to keep Indiana's city and county hospitals economically vital at a time when many rural hospitals nationwide are facing serious financial difficulties.

Critics argue, however, that the money flow has not significantly improved nursing home quality and has slowed adoption of community and home health services.

More than two-thirds of Indiana's Medicaid long-term-care dollars go to nursing homes, compared with the U.S. average of 47 percent.

"It is a factor that has contributed to our imbalance," said Joe Moser, who until May was the state's Medicaid director.

Daniel Hatcher, a law professor at the University of Baltimore and author of last year's "The Poverty Industry," said this funding arrangement undercuts the purpose of the Medicaid program. "The state is using an illusory practice and taking away money from low-income elderly individuals who are living in poor performing nursing homes," he said.

Proponents of the practice say that even when hospitals get most of the money, it is well spent.

Marion County Hospital and Health Corp., the large safety-net hospital system in Indianapolis, owns or leases 78 nursing homes across the state, more than any other county hospital.

Sheila Guenin, vice president of long-term care there, said the hospital keeps 75 percent of the additional Medicaid dollars and the nursing homes get the rest. Still, the additional money has improved care. The transfer of the license to the hospital has kept several nursing homes from closing and increased staffing rates at many others, she said.

About 40 percent of the county hospital's nursing homes have five-star ratings from the federal government, up substantially from 10 years ago, she said.

Still, some patient advocates said the extra funding is flowing to hospitals and nursing homes with little public accounting. Ron Flickinger, a regional long-term-care ombudsman in Indiana, said, "A lot of extra money is being spent here, but I'm not sure patients have seen it benefit them."

Medicaid, which typically covers about two-thirds of nursing home residents, is jointly financed by the federal and state governments. In Indiana the federal government covers about two-thirds of Medicaid costs.

Hatcher said Indiana officials embraced the funding arrangement because it let them avoid the politically difficult step of raising taxes to increase state funding to improve care at nursing homes. "It's a revenue generator for the state and counties," he said.

The federal government is tightening the rules about such payments.

Texas has secured Medicaid approval for a similar strategy starting this month, but federal officials have made the extra funding dependent on nursing homes meeting quality measures, such as reducing falls. Oklahoma is seeking to get federal approval as well.

Nursing home operators in Indiana say the financing arrangement has helped them keep up with rising costs and improve care for residents.

Zach Cattell, president of the Indiana Health Care Association, a nursing home trade group, noted the number of nursing homes in the state earning Medicare's top, five-star rating has increased 9 percentage points since 2011. He said the percentage of high-risk residents with pressure ulcers and those physically restrained also dropped significantly.

In Indiana, the small, county run rural hospitals generally are not facing the financial threat that has become common elsewhere, in part because of the extra Medicaid funding gained from buying nursing homes, hospital officials say.

"The money has meant a great deal to us," said Gregg Malot, director of business development at Pulaski Memorial Hospital in northern Indiana. His hospital is the only one in the county and received about $2 million a year from the practice. "I don't see this as a loophole but see it as an opportunity for small, rural community hospitals to improve our quality and access to care."

Kaiser Health News, a nonprofit health newsroom whose stories appear in news outlets nationwide, is an editorially independent part of the Kaiser Family Foundation.