The California Department of Corrections and Rehabilitation has revised policies regarding the use of force on mentally ill inmates, issuing some of the most detailed guidelines in the nation. The recent changes were prompted by the outrage that followed the court-ordered release of a video showing corrections officers using pepper spray and forcefully removing mentally ill inmates from their cells.

The order was issued in April by U.S. District Judge Lawrence K. Karlton, who urged “a systemwide culture change” in the way mentally ill inmates are treated in the justice system, and specifically, the way corrections officers handle them, the New York Times reported. A team of court appointed lawyers on the forefront of the crusade on the fair treatment of mentally ill prisoners was part of a group that spearheaded the revisions.

Karlton ruled unconstitutional the use of force and lengthy solitary confinement for inmates with severe mental illnesses. As a result, California will require an examination of the “totality of circumstances involved” by a certified mental health professional, including a mental health evaluation before corrections officers, before force against a particular inmate is authorized. The new policy also requires a “cool-down period,” during which mental health professionals try to decrease tensions.

New policies also limit the instances and amount of pepper spray that can be used, and require prior approval by the prison warden or another top official.

The demand for specific guidelines for mentally ill inmates has increased as the system’s population grows to include more mentally ill prisoners. The Times reported in 2013, a little more than 28 percent of California’s prison population was diagnosed with a variety of mental illnesses. Depending on the nature of their illness, inmates can sometimes become targets for cell-extraction using pepper spray, Tasers or other non-lethal weapons because officers have not been trained or equipped to handle inmates with psychiatric issues.

The policies will begin going into effect starting next year and will also include additional training for corrections officers as well as other prison staff members.