Top White House lawyer Don McGahn is parting ways with Donald Trump as so many people do—messily, and with bad feelings on both sides. But part of McGahn’s legacy has little to do with his erstwhile boss: Well before Trump, McGahn played a crucial role in weakening US protections against compromised elections.

McGahn’s pending departure was tweeted by the president this week, an apparent attempt to reclaim the narrative after unnamed sources publicized McGahn’s plans to quit. After the White House, the 50-year-old attorney is expected to slip back into private practice, continuing a decades-long career as a corporate lawyer and long-time counsel to the National Republican Congressional Committee, a career that was interrupted by just over six years in public service.

But oh, what a six years it was. Before McGahn joined the Trump White House in January 2017—after serving as Trump’s campaign lawyer—he was appointed by George W. Bush to the Federal Election Commission from 2008 to 2013. While there, critics say McGahn single-handedly presided over the destruction of one of the two US agencies responsible for insuring that the US’s elections remain truly democratic.

(The other agency, the FBI, is currently enmeshed in an examination of whether the Trump campaign colluded with Russia to impact the 2016 election. Ironically, information provided by McGahn may become a key part of that investigation.)

McGahn was handpicked by then Senate minority leader Mitch McConnell for the FEC, recalls Ann M. Ravel, who served on the commission from 2013 to 2017. Once there, he quickly whipped Republicans into a solid voting bloc that nearly always opposed additional regulation, oversight, or even investigation. Because the FEC needs four of six commissioner votes to take any action, the net result was a completely broken agency, incapable of enforcing any election laws.

“His entire tenure at the FEC was to decimate the ability of the commission to fulfill its job,” Ravel said. Adav Noti, the FEC’s former associate general counsel, said McGahn may have been the most influential FEC commissioner of the century.

In his 21 months with the Trump White House, McGahn has had a different kind of impact, spearheading an unprecedented push—again with McConnell’s blessing—to fast-track conservative judges on to the bench. McGahn’s handpicked judges (mostly white, mostly male) will make decisions on everything from gerrymandering of voting districts to voter ID requirements—issues that determine how representative America’s political leaders are of the citizens they serve.

“The dozens of federal judges he selected will help corporations and rich people continue to buy elected officials for many years to come,” Noti predicts.

The Republican party, thanks to US demographic shifts and Trump, is shrinking. But McGahn’s short federal career will help ensure that the GOP keeps a powerful hold on America’s future.