A federal district court has cleared the way for our lawsuit against the U.S. Department of Agriculture’s irresponsible and dangerous plans for responding to outbreaks of Highly Pathogenic Avian Influenza, commonly known as the “bird flu.”

The agency’s current plans, which we and our allies challenged in court last year, incentivize large factory farms that treat animals miserably, by packing them in tight cages or barren warehouse-like facilities. When there is a deadly bird flu outbreak in such operations, the USDA requires them to kill every animal and allows this to be accomplished with a cruel method called ventilation shutdown—a practice where the conscious birds are slow cooked to death by shutting down the entire ventilation system and allowing carbon dioxide and heat to build up.

Once the “cleanup” is complete, the USDA reimburses the producers with taxpayer dollars so they can go right back to restocking their cages and barren barns with more animals. This does nothing to solve the root cause of the disease outbreak: factory farming.

Factory farms present the perfect environment for viruses to spread rapidly and mutate. That’s why, five years ago, we suggested a commonsense plan to the USDA asking that it incentivize producers who give animals room to move naturally, thus reducing the risk of disease spread, instead of rewarding those who cram animals into cages.

Unfortunately, the USDA refused to even consider this plan. When we challenged this decision in our lawsuit last year, the USDA attempted to have it dismissed by claiming that the possibility of another bird flu outbreak is too speculative and that it was not responsible for the harms associated with its own plan as well as powerless to mitigate any problems arising from it.

Fortunately, the court refused to dismiss our lawsuit and that means the agency will have to try to defend these weak arguments.

We are grateful for this win, and we hope it will pave the way for ending some of the worst practices in animal agriculture. Between 2014 and 2016 more than 50 million birds, including egg laying hens, chickens raised for meat, turkeys and others, were killed across more than a dozen states in an effort to contain a bird flu outbreak. But it was not just the animals who suffered; the outbreak caused up to three billion dollars’ worth of damage to the U.S. economy, and the USDA spent over $900 million cleaning up the mess it described as the most serious animal health disease incident in history. In this and other instances, the USDA has demonstrated that it has failed to learn from these past mistakes. But we will not stop working toward the day when our government is no longer offering a helping hand to those who commit the most terrible abuses against animals.

The lawsuit was prepared and defended by pro bono counsel at the law firm Shearman & Sterling, LLP and the HSUS’s Animal Protection Law team along with co-plaintiffs, Mercy For Animals and Farm Sanctuary.

Sara Amundson is president of the Humane Society Legislative Fund.