The Justice Department’s 2015 report examining police practices in Ferguson, Missouri, revealed the ways that the local government’s dependency on money from court fines and fees turned law-enforcement officials into de facto tax collectors and citizens into deliberate sources of revenue for the city.

But while Ferguson put this practice on the map, it’s hardly isolated there. In the years since the report’s release, officials elsewhere have examined how their own fines and fees, to varying degrees, burden residents—particularly poor ones. This is the case in Texas, which last month marked a turning point: To reduce the disproportionate impact these debts have on low-income people, the Republican-led state legislature passed a law to curtail the practice of jailing those who can’t pay court-imposed bills.

Debtors’ prisons were outlawed nationally in 1833, but their essential function nevertheless persists in states across the country, and penalties are imposed for crimes large and small. In Texas last year, 95 percent of warrants stemmed from outstanding fines. Also in 2016, the state jailed 640,000 people who couldn’t pay their debts for minor, ostensibly fine-only offenses—like public intoxication, missing a stop sign while driving, or letting a dog run loose where it’s supposed to be leashed.

The new law applies to just those kinds of low-level crimes. After it goes into effect September 1, judges will be required to offer low-income defendants a community-service alternative to fines and fees. Further, judges will be able to fully or partially waive debts if the alternative would “impose an undue hardship.” “It’s truly an incredible victory in a state where poor people and minorities tend to be side-lined,” said state Representative Terry Canales, a Democrat from South Texas who’s one of the bill’s sponsors. “We’ve historically been a ‘lock ’em up’ state.”

The bill may very well alleviate hardship for individual Texans. But it doesn’t go very far in tackling the state government’s reliance on court revenues. To wit: The original law eliminated a $25 late fine and a $2 transaction fee for payment installments—“basically, fees that you don’t have to pay if you’re able to pay all at once,” explained Ted Wood, a Harris County public defender who testified in support of the bill. Its sponsors had to nix those provisions in order to get it passed. Lawmakers also recently added another fee to the courts’ roster: a $2 charge to file civil cases, which will fund courtroom security.

Such small increases have accumulated to form the complicated fine-and-fee structure that so many state government programs rely on today, said David Slayton, administrative director of the Texas Office of Court Administration. “It’s been nickel-and-diming over a period of time that [has] increased the fees and fines,” Slayton said. “In an individual bill, it doesn’t look like a big impact, but when you add up the five or six occurring in a session, then obviously it has a bigger impact.”

These costs can throw people into a cycle of debt, particularly if unpaid dues lead the state to yank their driver’s licenses as a penalty. Nearly 2 million Texans have suspended licenses for this reason. Revoking their ability to drive impedes their ability to hold steady employment, and delays or prevents them from paying back debts. Late charges, too, are added for delinquent payments, so the amount owed often keeps growing. (Though the new law passed with broad bipartisan support, including from Republican Governor Greg Abbott, there was a contingent of lawmakers wary of its provisions: State Senator Paul Bettencourt, a Republican from the Houston area, opposed the bill because it didn’t factor in “personal responsibility,” he told me in an email.)

Officials in Texas have had concerns about court fines and fees for several years. Slayton’s agency released a comprehensive report on them in 2014—the first of its kind in the state. That analysis introduced policymakers to the problem, and the Ferguson report further catalyzed calls for reform. Two main issues troubled the report’s authors: One was the complicated patchwork of levies the state had created. At the time, there were 143 distinct criminal-court costs separated into 17 categories, as well as 211 distinct civil-court costs in 18 different categories. Though the legislature signs off on fewer fines and fees today than it used to, there are likely a few more on top of the ones from 2014, said Slayton, who was the report’s lead author.

“It’s like when you go to the hospital and get the bill, and it’s like, ‘What is all this?’” Canales said. “There are all kinds of fees that the average citizen doesn’t see them so much; he doesn’t even know that they’re around.”

The second issue was that some dues are used to finance programs unrelated to the courts. In fiscal year 2013, for example, court fees generated over $408 million for the state, but only about half went to the judiciary. Funds in the remaining half didn’t necessarily go to law enforcement or other criminal-justice-related programs either. Adding salt to the wound, city and county courts, which are primarily funded by local tax revenue, remain underfunded because of the way revenue is distributed.

To fix these issues, “the goal would be to simplify it down to as few [fines and fees] as possible,” Slayton said. “And then make sure that whatever filing fees and court costs are being collected are allocated to purposes related to the administration of that case.”

But that still may not be enough. The state of Texas has legislated itself into a situation where divestment from court-collected funds would require officials to conjure up significant alternative sources of money—not an easy task for lawmakers in a notoriously tax-averse state. Slayton acknowledged that obstacle: “I think the issue has been finding sources of revenue to fund these other programs.”

Texas is certainly not alone in its conundrum. A 2014 NPR investigation traced the roots of rising court fees to the tough-on-crime era that began in the 1970s. The increased number of prosecutions escalated the cost of running courts. States began to compensate by charging defendants, a practice that expanded over the ensuing decades and was accelerated by tightened state budgets. The NPR report found that between the 2008 financial crisis and 2014, 48 states increased criminal- and civil-court fees.

Recently, some reformists in Texas have had success using the courts, not the legislature, to get these levies expunged. In March, the Texas Court of Criminal Appeals found that part of one fee constituted an unconstitutional tax. The case, Salinas v. State, centered on a penalty charged to every criminal offender in the state; it costs between $40 and $133, depending on the severity of the crime. Ten percent of the money collected funds local court operations, while the other 90 percent was originally divided between 14 state programs.

The court found that the state shouldn’t have funneled revenue to two of them: a rehabilitation program for people with traumatic brain or spinal-cord injury, and a fund titled “Abused Children’s Counseling,” which for 10 years had been redirected to the state’s general-revenue coffers. Because these recipients were unrelated to the criminal-justice system, the money used to fund them constituted a tax unlawfully imposed by the judiciary, the presiding judge on the case, Sharon Keller, wrote in her opinion:

Because the constitutional infirmity in this case is the statute’s failure to direct the funds to be used in a manner that would make it a court cost (i.e., for something that is a criminal justice purpose), the fee operates unconstitutionally every time the fee is collected, making the statute unconstitutional on its face.

Following the ruling, the legislature quickly redirected the two programs’ revenues to indigent defense, and funneled money from the state’s general fund to keep the rehabilitation initiative going.

The defense lawyer in the case, Jani Maselli Wood, was disappointed that the ruling didn’t lower her clients’ court fees. But, she said, the larger benefit is that the judges validated the idea that the courts shouldn’t be collecting money for non-criminal-justice-related programs. “In the end, it’s a victory just knowing that the courts say that the legislature can’t just pass some costs, and pass them on to criminal defendants because they’re unpopular people,” she said. She plans to continue litigating against similar penalties: “There are a lot of other fees that fall into that same category.”