President Trump's administration is killing one of former President Barack Obama's most dangerous overreaches, the Clean Power Plan. Federal law as currently interpreted won't let the administration stop there. The Environmental Protection Agency will probably need to replace the plan. This needs to be done with care, and warily, for there will be much special pleading for favors by different industries, and many legal pitfalls.

You may recall when Democrats lost control of Senate after the 2014 elections, Obama belittled Congress and boasting that he'd go around it with executive orders — his "a pen and a phone." The next year, his EPA issued the Clean Power Plan, seeking to impose by fiat what even a Democratic Congress had rejected, regulating greenhouse gas emissions by power plants.

After the House passed the Waxman-Markey climate bill in 2009, Senate Democrats, even with a 60-vote supermajority, couldn't get the bill across the finish line.

Instead, Obama leaned on the Supreme Court ruling in Massachusetts v. EPA which found somehow that the Clean Air Act required the EPA to regulate greenhouse gas emissions from power plants.

Through the 2015 Clean Power Plan the Obama administration implemented that ruling, but not by actually regulating emissions from power plants. The rule created a complex scheme whereby utilities had to come up with various ways to mitigate or minimize emissions from the power sources on which they relied.

The Supreme Court put a stay on the CPP, which was legally suspect, before it went into effect. Trump's EPA this week announced it was pulling the plug on Obama's rule.

That's a great move. The problem is that the Supreme Court ruling probably requires Trump to replace Obama's rule with another rule. If the EPA is required to regulate greenhouse gas emissions from power plants, then Trump's EPA needs to find the best way to do this.

The obvious first principle for any new regulatory scheme is minimizing economic harm. Trump made it clear throughout the campaign that he saw the Clean Power Plan as a costly destroyer of jobs. His new plan should be written so as to relieve that burden as much as possible.

That's the easy part. The hard part is avoiding sloppiness and playing favorites, both of which are likely pitfalls for Trump's policymakers.

The executive branch does not have carte blanche to regulate or deregulate. Just because Obama wrote the Clean Power Plan doesn't mean Trump can replace it easily. The term "stroke of the pen, law of the land," is an overly simple description of executive action. The Clean Power Plan took years to draft because it had to comply with the Court's reading of the Clean Air Act and the Administrative Procedures Act.

The Trump administration has not always been careful making rules — the first immigration executive order was a classic of the genre — in ways that have undermined its goals.

The greater risk in this case, however, is favoritism. Candidate Trump put much stake in restoring the coal industry. Indeed, coal country is suffering, and Obama hogtied the industry with red tape.

That doesn't mean Trump should rig the rules to help coal, as early hints suggest it may. Any new climate rules should be as neutral as possible. EPA administrator Scott Pruitt put it well: "Regulatory power should not be used by any regulatory body to pick winners and losers."

Trump and Pruitt, we hope, understand the difference between minimizing harm and helping industries. A wise policy would meet the statutory requirements and so defang inevitable environmentalist lawsuits, while refusing to favor coal, gas, nuclear, or renewables.

In replacing Obama's rule, the EPA's job is not to help any particular person or industry, it is to help everyone by doing no damage, and by undoing damage already done.