Facing the need to balance their budgets next year, states are examining a variety of changes to their Medicaid programs even as Republicans weigh a major spending overhaul to the healthcare program for the poor.

The changes underscore the difficulties of structuring the Medicaid program, which has little consensus across states or residents over who should qualify for it and what constitutes an appropriate level of spending. Obamacare aimed to make Medicaid more uniform by requiring states to expand it to more low-income people, but the Supreme Court ruled that portion of the bill would be optional. The District of Columbia and 31 states expanded Medicaid, leaving uneven strides in coverage from state to state.

Facing shortfalls overall, state lawmakers continue to look at Medicaid as a target for cuts or changes.

“There’s that continuing struggle for states to pay for their share regardless of whether they expanded Medicaid under the Affordable Care Act,” said Stacey Mazer, a senior staff associate at the National Association of State Budget Officers, referring to Obamacare.

Policymakers have questioned whether Medicaid is sustainable, as it is the second-largest portion of state budgets while medical costs increase faster than the economy.

The House bill to repeal and replace Obamacare, called the American Health Care Act, would allow states to choose to structure their Medicaid programs as a block grant or per-capita program, which would fix funding on Medicaid for the federal government rather than leave it open-ended. Over roughly a decade, such a proposal would reduce federal spending by more than $800 billion and Medicaid rolls by 14 million people, figures that have concerned some Republicans who say they fear people will lose coverage or access to medical care. Others, however, say that Medicaid needs restructuring because it makes up 10 percent of federal spending and contributes to the national debt.

The potential cuts have left lawmakers deeply concerned, but states themselves also are looking to make changes to Medicaid in an effort to balance their budgets. Obamacare continues to be the law of the land, and the states that expanded Medicaid are preparing to spend an average of 5.9 percent more now that the share of federal dollars is being drawn down. The federal government paid the full share of expansion for new beneficiaries through 2016, but this year states entering their third year of expansion are taking on 5 percent of the cost. The share continues to grow gradually until 2020, when states are responsible for 10 percent of the cost.

At least eight states chose to increase the provider tax to help pay for expansion. Colorado, for instance, set up a hospital provider fee of up to 6 percent of net patient revenues, which is then matched by federal dollars.

“Consequently, Colorado is able to pay its state share of the Medicaid expansion population without impacting the state’s general fund,” said Marc Williams, public information officer for the state Department of Health Care Policy and Financing.

In Oregon, Democratic lawmakers considered undoing Medicaid expansion as the state faced a $1.6 billion budget shortfall. By cutting expansion, the state projected it could save $256 million over two years. To maintain funding, however, Republicans presented another plan that would include increasing taxes on cigarettes and e-cigarettes. A similar plan helps finance overall Medicaid spending in California.

Arkansas is considering changes to its Medicaid program as a way to pay for the state’s share of expansion, said Brandi Hinkle, deputy chief of communications for the state’s Department of Human Services.

“We are required to have a balanced budget, and when we have to take on a part of the cost, that affects our budget,” Hinkle said. “Some programs have to be adjusted. … It’s fiscally responsible for the state of Arkansas to change some of its requirements.”

The program would shift Medicaid expansion enrollees onto Obamacare’s exchanges if they made between 100 and 138 percent of the federal poverty level, shedding more than 60,000 people from state rolls and shifting costs to the federal government. The state also is considering adding work or education requirements that include exemptions for people in addiction treatment, children, pregnant women and others.

“We are hoping that people who participate in workforce training or going to school will start to learn or be employed and move up the ladder so they become eligible for employer insurance,” Hinkle said.

In Kentucky, Republican Gov. Matt Bevin has said the expansion of Medicaid enacted by his Democratic predecessor, Steve Beshear, isn’t sustainable. The commonwealth filed a Medicaid waiver that would include work requirements and premium payments by beneficiaries.

Robin Rudowitz, associate director for the Program on Medicaid and the Uninsured at the Kaiser Family Foundation, notes that some research has shown that Medicaid expansion has helped states achieve savings in other parts of their budgets and that providers have seen a reduction in uncompensated care costs. The struggles individual states are having are linked to shortfalls in revenue, she said.

“More states are reporting slowing of revenue growth and budget shortfalls overall,” she said. “Not to say the expansion doesn’t complicate that, but it’s largely a reflection of slowed revenue growth.”

With the blessing of the Trump administration, which has encouraged flexibility, states that did not expand Medicaid also are considering changes. According to the Kaiser Family Foundation, those states face spending growth of 4 percent this year, a projection similar to recent years.

In Wisconsin, lawmakers are considering drug testing recipients and implementing a work requirement.

Critics of such programs say that they hurt a demographic Medicaid is supposed to help and are intended to assuage middle-income voters as they stigmatize low-income residents.

“They do deserve help, and a lot have serious problems, as well as mental health problems, so care is expensive and hard,” said Joe Antos, healthcare economist for the conservative American Enterprise Institute. “But that is not a sympathetic demographic.”

Medicaid covers 43 million Americans, with 15 percent of Medicaid dollars nationwide going toward able-bodied people. Most funding goes toward children, older Americans and people who are disabled.

At the state level, other changes are afoot. Florida submitted a Medicaid waiver to the federal government to be allowed to receive its Medicaid funding as a block grant. In Massachusetts, Republican Gov. Charlie Baker suggested in his budget charging small businesses $2,000 a person if they don’t cover 80 percent of full-time workers. Enrollment in the Medicaid program is at a record high in Massachusetts, where state data has suggested that employees have moved from employer plans onto Medicaid or are not being offered coverage at all. The program takes up just under 40 percent of the state budget.

Lawmakers in expansion state Nevada are considering going in the opposite direction. They have sent a bill to Republican Gov. Brian Sandoval that would allow anyone who is uninsured in the state to buy into Medicaid, regardless of income or health status.

The changes, even as Congress debates how to repeal and replace Obamacare, demonstrate a continued struggle in defining the program.

“There has never been a clear consensus in this country about the Medicaid program and who should be covered,” Antos said. “So what Washington did was cover sympathetic groups, and while it might be a good political decision, it doesn’t necessarily make any sense in terms of what problems exist.”