On Wednesday, Washington Gov. Jay Inslee (D) signed a bill setting welfare requirements for egg-laying hens — the strongest such bill ever to pass a state legislature. By 2023, it will be illegal to sell eggs in Washington if the hens were raised in excessively small cages. The law will affect about eight million hens each year.

The Washington law follows up on the success of ballot measures in California and Massachusetts, which imposed similar requirements. The Humane Society of the United States has spearheaded campaigns like this one in more than a dozen states, and in the past few years, these campaigns have started to get results.

Why is this a big deal? Because millions of birds live on factory farms producing eggs, and the conditions they’re kept in are pretty terrible. We’re finally making progress towards improving those conditions.

There are many ways to raise egg-laying hens on a factory farm. One method, battery cages, keeps each hen in an area about 67-76 square inches big (that’s approximately the dimensions of an iPad). Birds show a lot of distress under those conditions, tending to injure themselves, lose their feathers, and end up covered with cuts and bruises.

The alternative methods aren’t great for birds either, but welfare researchers think they’re a little better. The cheapest alternative method (and therefore the one that most producers will likely switch to) is called an aviary system. Those look like this:

Aviary systems have their problems — in particular, with more mobility and freedom comes more ways for birds to get injured or sick — but on the whole, they seem to cause less suffering. Washington will require that birds have enough space to turn around and spread their wings; that they’ll have access to perches and dust baths; and that they will be able to socialize with other birds. It’s a start on the path toward humane conditions.

Washington’s law isn’t unique — it’s a lot like the California or Massachusetts laws — but it’s unique in one important way: it’s the first time a law like this has happened through the state government, instead of directly through voters.

For the most part, voters have been more concerned with animal cruelty than our representatives have been. Initiatives that protect animal welfare have had a striking success rate at the ballot box. Voters have banned gestation crates and battery cages in California and Massachusetts, limited puppy mills in Missouri, and restricted the sale of ivory and animal parts in Oregon and Washington.

Meanwhile, legislatures have tended to push the other way. Six state legislatures have banned undercover investigations of factory farms, Iowa passed a law requiring grocers to sell caged eggs, and the federal government is contemplating restrictions on cell-based meat (which is produced without slaughtering animals). The last major federal bill targeting farm animal welfare was introduced in 2010, and it never passed.

That’s an unusual level of disconnect between constituents and lawmakers. One explanation is that agricultural lobbies tend to be politically powerful and well-connected, and can usually discourage legislators from taking animal welfare concerns too seriously, while they tend to lose when factory farming practices have to be defended to the public.

Washington’s law is a welcome sign that things might be changing. Protections for animal welfare are a good idea — politically popular, morally necessary, and not even all that costly. If legislators have started to get on board, that’s great news.

Sign up for the Future Perfect newsletter. Twice a week, you’ll get a roundup of ideas and solutions for tackling our biggest challenges: improving public health, decreasing human and animal suffering, easing catastrophic risks, and — to put it simply — getting better at doing good