After two debates over four nights, the direction of the Democratic presidential contenders is clear. The hopefuls for the nomination are running against the president in order to raise their profile and win disaffected Democrats to their banner.

Unfortunately for Democrats, they seem to be obsessed with the wrong president. While paying lip service to attacking Donald Trump on a personal basis, the 2020 candidates have spent much of their time up to this point going after Barack Obama — still the most popular man in the party.

Was this inevitable after Joe Biden jumped into the race? Biden, who served as Obama's loyal vice president, wants to run using Obama's mantle of leadership as well as Obama's policy track record over the eight years of his presidency. To take criticism of the Obama presidency off the table for the debates would have amounted to unilateral disarmament by his competitors as Biden promises to turn the clock back to a pre-Trump time for Democrats.

Still, his competitors have nearly a half-century of Biden's own Beltway track record from which to attack Biden and could have chosen to stick to his Senate record instead. Some of that has already been put to use, such as Kamala Harris' swipe at Biden's old position on busing, which turned out to be a mostly empty shot. They also could have gone about attacking Biden's claim on the Obama legacy — how much does a vice-president have to do with an administration, anyway?

Instead, Biden's competitors have gone into full attack mode on the Obama legacy itself. On both nights of the second debate, multiple candidates attacked the present health-care status quo created by the Affordable Care Act, Obama's signature legislation, by demanding its dismantlement and replacement with Medicare-for-all, isolating Biden as ObamaCare's primary defender.

When Bill de Blasio stated that "there's a mythology that somehow all of these folks are in love with their insurance companies," CNN's Dana Bash asked Biden about claims that the "health-care system ... is not working." Biden replied that "ObamaCare is working," and that the solution is to fix rather than replace it. In short succession, Biden was then contradicted by Sens. Kirsten Gillibrand, Kamala Harris, and Cory Booker.

Nor was ObamaCare the only part of the Obama legacy that was attacked. Trump's record on immigration enforcement is a clear target for Democrats in 2020, just as it was in the 2018 midterms, but the presidential candidates have expanded their attacks to traditionally bipartisan approaches, including the practices of the Obama administration. Julián Castro rebuked Obama-era Homeland Security Secretary Jeh Johnson for his warning that decriminalizing unauthorized border crossings was tantamount to "open borders."

De Blasio turned that attack directly on Biden and Obama in a follow-up on the topic. "I didn't hear your response when the issue came up of all those deportations [during the Obama years]," he scolded the former VP. "You were vice president of the United States. I didn't hear whether you tried to stop them or not, using your power, your influence in the White House."

Biden shrugged off the question when de Blasio attacked again, stating, "I keep my recommendation to him in private." Booker then ripped Biden for dodging responsibility for deportations. "First of all, Mr. Vice President, you can't have it both ways. You invoke President Obama more than anybody in this campaign. You can't do it when it's convenient and then dodge it when it's not."

Why would Democrats attack their most popular figure in their own primary? Booker later tried justifying it by claiming that the party needs "an honest conversation" about Obama's legacy. While Trump is "perverting our very values and ideals," Booker claimed, Democrats also need to talk about how "our plans would be different from the previous president, different from the current president."

That is a very risky strategy. Obama was hardly a centrist while in office, but succeeded in large part because of his personal connection to voters and an ability to keep the center engaged. Democrats had already lurched to the left in this cycle, but attacking Obama on issues like health care and immigration is practically a declaration of extremism to most voters. That will cost them at the ballot box, perhaps most particularly in those suburbs that gave Democrats a House majority in the midterms.

Furthermore, it sets up an implicit equivalency between Trump and Obama that won't play well at all for Democrats outside of their activist base. Booker hinted at it in his defense, suggesting that Trump and Obama aren't that far apart on policy, which is actually true on issues like deportations and keeping "babies in cages and separat[ing] children from their parents," as Harris fumed on Wednesday. The Associated Press reminded its readers during the debate that the Obama administration did both too. Such attacks not only make Democrats look more radical, they make Trump look more mainstream at the same time.

That alone may have made Trump the Democratic debate's biggest winner by the end of its second round. If nothing else, Barack Obama was certainly its biggest loser, without a single Republican voice on the stage. Democrats should ask themselves which president they truly want to run against.