Nearly 4,500 of Illinois’ mentally ill nursing home residents soon will have the option of moving into community-based programs, according to the terms of a groundbreaking settlement between the state and the American Civil Liberties Union.

The new care settings will provide better care for the mentally ill at a lower cost to state taxpayers, according to state mental health advocates. The state could save up to $50 million in the next few years through additional federal Medicaid assistance for community-based care, according to one projection, the Chicago Tribune reported. The 4,500 residents of the state’s two-dozen “institutions for mental diseases” (IMDs) will be voluntarily evaluated over the next two years and placed in a less restrictive care setting based on their eligibility.

The settlement comes shortly after a string of Tribune articles exposing the poor treatment of mentally ill nursing home residents spurred a statewide reformation of the long-term care system. The settlement only covers residents of IMDs. There are still approximately 10,000 mentally ill patients at nursing homes that are not classified as IMDs, according to the Chicago Tribune.