“By the way, now I know what the Moreland Commission must have felt like,” Bharara tweeted on Sunday afternoon. It was a reference to the independent body set up to investigate New York Governor Andrew Cuomo in 2013 to investigate political corruption; he abruptly shut it down in early 2014 after passing modest ethics reforms.

Bharara then stepped in with an investigation of the circumstances in which the commission was disbanded. Over the next couple of years, Bharara’s office indicted the leader of the state’s assembly, of its senate, and of top aides to Cuomo—demonstrating, emphatically, that there actually was pervasive corruption in New York state government, but that the Moreland Commission had been disbanded too quickly to make it public. Now Bharara shares its fate—forced from office before he could bring inquiries he was reportedly pursuing to completion.

Trump had every right to demand the resignations. But the manner in which he removed half of the nation’s chief federal prosecutors still raised eyebrows. During the transition in January, Trump had asked the attorneys, as well as certain high-ranking Justice Department personnel, to temporarily stay on after his inauguration on January 20. The request was a largely practical one: Each of the 93 U.S. attorneys represents the United States in civil lawsuits and serves as the top prosecutor in federal criminal trials within their jurisdictions.

Those roles can be sensitive and complex in nature, so it’s not unreasonable to keep them in place until their successors can be named. Some U.S. attorneys soon stepped down nonetheless, leaving career civil-servant prosecutors in charge in the interim. But the Trump administration seems to have jumped the gun on replacing the rest: None of their designated successors have been named, and those ousted were reportedly caught off-guard by the requests to resign. CNN reported that one of the attorneys found out he was being ousted through social media; others didn’t receive a call from Dana Boente, the acting deputy attorney general, until after the Justice Department made the announcement.

Forcing out the U.S. attorneys en masse on a Friday night may have been sloppy, but it isn’t unprecedented. Bill Clinton, the first Democratic president in more than a decade at the time, sought a similar mass resignation from the Reagan and Bush-era U.S. attorneys in 1993. (Among those ousted at the time was Jeff Sessions, then serving as the U.S. attorney for the southern district of Alabama.) George W. Bush and Barack Obama also oversaw mass turnovers among the nation’s chief federal prosecutors, albeit in a less dramatic fashion.

Trump and his predecessors acted well within their powers. All U.S. attorneys serve four-year terms “at the pleasure of the president,” a legal term of art that distinguishes a relatively small group of federal political appointees who rotate in and out as presidents change from the far greater multitude of career civil servants. A series of anti-corruption reforms in the late 19th century ensured those federal workers are both nonpartisan and insulated by civil-service laws. But those protections don’t extend to political appointees.