With Joe Biden on the debate stage Wednesday night, the other Democratic primary candidates will have another chance to criticize elements of his long political record. But Biden’s presence — and his wholehearted embrace of his time as second-in-command during the “Obama-Biden administration” — also creates an opportunity for his rivals to take on President Obama’s legacy, particularly on policies like immigration.

We’ve already seen a preview of what this might look like. In the first debate, Kamala Harris criticized a deportation program that operated for much of Obama’s presidency and required cooperation from local and state law enforcement, saying it allowed for the deportation of non-criminals. And more recently, Julián Castro said it is “inevitable” that Biden will have to respond to the record-breaking number of deportations that occurred on Obama’s watch. By some measures, Obama did deport more people than any other president in modern history, something for which many immigration rights advocates still criticize him. He also detained families until the courts made him stop, although his administration didn’t have a policy of family separation, as President Trump has claimed.

Disavowing Obama’s stance on immigration is complicated for Democrats, though — and not just because the former president remains wildly popular among the party. He also issued Deferred Action for Childhood Arrivals, the executive order that protected young undocumented immigrants from deportation, at the end of his first term. Plus, by the end of his second term, his deportation numbers had fallen significantly, and his policies were closer to what some of the 2020 candidates are now proposing. And, of course, because Trump has adopted a harsher strategy on immigration enforcement, it has been less pressing for primary candidates to argue against Obama-era policies. But this doesn’t mean Obama’s immigration record won’t loom large over the primary. In fact, the extent to which candidates embrace Obama-era immigration policies could emerge as an important dividing line.

Obama was very tough on immigration at the beginning of his presidency

During the first few years of his presidency, Obama earned the nickname “deporter in chief” due to the high numbers of undocumented immigrants deported during his first term. This marked a sharp contrast with the comprehensive immigration reform he had promised on the campaign trail. And over the course of Obama’s time in office, more than 3 million unauthorized immigrants were removed from the country, compared to about 2 million immigrants under President George W. Bush and less than a million under President Bill Clinton.

But there is some debate about how record-setting Obama’s numbers actually are, because of a trend in the type of deportations that were prioritized. A majority of the deportations that occurred during Obama’s presidency were “removals,” which involves a formal court order and legal consequences like ineligibility to reapply to enter the country for a certain period of time. In earlier administrations, though, the bulk of the deportations were “returns,” where immigrants were caught at the border and simply turned around. As you can see in the chart above, returns were much higher under Bush and Clinton than under Obama and accounted for a much larger proportion of total deportations. Obama’s deportation numbers would look less striking by comparison if returns and removals were counted together. That said, several immigration experts I spoke with said that removals are more reflective of a concerted immigration enforcement agenda, since the number of returns are tied more closely to trends at the border. So, the Obama administration still ejected a lot of people from the country in a way that made it more difficult for them to reenter.

Another way to gauge the relative severity of a president’s approach, according to Alex Nowrasteh, the director of immigration studies at the libertarian Cato Institute, is to ignore the border altogether and look at deportations from within the United States. “As far as we can tell, Obama deported more people from the interior of the U.S. than any other president in American history,” Nowrasteh said. “He inherited a system that was accelerating deportations and accelerated them even more.” And over the course of his administration, Obama removed about 1.2 million undocumented immigrants from the heart of the country.

The bulk of these removals were concentrated in Obama’s first term, when his administration rapidly expanded a program that created partnerships between local and state law enforcement and federal immigration authorities — the one Harris criticized during the first debate. Under the program, any immigrant taken into state or local custody would have his immigration status checked against a federal database. If he was unauthorized, the police would hold him for additional time so federal agents could come pick him up. “2011 and 2012 were high-water marks of immigration enforcement and a good chunk of that happened through our criminal justice system,” said Muzaffar Chishti, director of the Migration Policy Institute’s office at NYU School of Law. Critics argued that rather than targeting dangerous criminals for deportation, the program mostly identified low-level offenders or even people without criminal records, while scaring other undocumented immigrants out of reporting crimes.

Obama’s immigration policy shifted later in his presidency — but he was still criticized

But toward the end of Obama’s first term, his approach to immigration enforcement began to shift, although immigration advocates and experts are still divided about what this means for his legacy. In the summer of 2012, facing increasing political pressure from immigrant rights groups, he issued the DACA executive order, which shielded some young undocumented immigrants from deportation and allowed them to apply for work permits. And starting in 2011, his administration issued a series of memos that gradually narrowed the types of immigrants who were priorities for deportation, so that by the end of his second term, deportations from the interior of the country had fallen significantly.

Immigration policy experts like Chishti think Obama deserves credit for adjusting his policies as his presidency went on. According to estimates by Chishti’s group, by the end of Obama’s presidency, as many as 87 percent of unauthorized immigrants were not priorities for removal. “Interior removals fell hugely and he never got credit for that,” Chishti said. Experts also told me that Obama was trying to prove to Republicans in Congress that he was tough on immigration, in the hopes that they would work with him on comprehensive immigration reform. “When a legislative solution fell apart, he switched to a less punitive approach,” said Stephen Yale-Loehr, a professor of immigration law at Cornell Law School.

Others are less inclined to be generous to Obama. The partnership program with state and local police didn’t end until 2014, after a number of states and cities rebelled and tried to stop participating. (Trump has since restarted this program, although many cities and states are resisting as part of the “sanctuary city” movement.) And in response to a surge of unaccompanied migrant children and families who crossed the border in 2014, Obama ramped up family detention until the courts made him stop — although unlike Trump, he never had a formal policy of separating families. “That’s a big blemish on Obama’s record,” said Bill Ong Hing, a professor of law and migration studies at the University of San Francisco. “He didn’t really separate families but he definitely detained them.”

Many of the Democratic candidates have landed to the left of Obama

Trump’s approach to immigration, which is unquestionably more punitive than Obama’s, will likely continue to dominate the primary, with the candidates eager to draw a contrast with Trump. In fact, they have almost uniformly lined up behind some Obama-era immigration policies, like DACA. But other elements of Obama’s legacy could still emerge as contentious issues among Democrats.

One notable area of dispute emerged during the first debate, when Castro got into a tiff with Beto O’Rourke about whether crossing the border at places other than official ports of entry should be a crime. Castro has argued that illegal border crossing should be only a civil offense, while O’Rourke says applying a criminal violation is still necessary to hold smugglers and drug traffickers accountable. And in the aftermath of the debate, Obama’s former Secretary of Homeland Security, Jeh Johnson, argued that decriminalizing illegal border crossings would be a mistake. But in her comprehensive immigration plan released in mid-July, Elizabeth Warren also expressed her support for decriminalizing unauthorized border crossings.

Other candidates are promising broader immigration reforms — just like Obama did back in 2008. But unlike Obama, who initially expressed reluctance to rely on executive action, many are explicitly saying they won’t rely on legislation alone to get things done. Harris, for example, has said she’ll use executive action to shield undocumented immigrants from deportation. Booker’s plan also promises to crack down on poor conditions in immigration detention facilities, which was something Obama was criticized for. A number of candidates have even rejected elements of the Obama administration’s more focused immigration priorities, saying they would only focus on violent criminals and people who pose national security threats, according to a tally by The Washington Post.

At this point, it’s important to emphasize that these contrasts are subtle, and candidates are mostly focusing on how they’d differentiate themselves from Trump. The call to decriminalize border crossing, for example, is a response to Trump’s use of the law to separate families. And the focus on Trump makes a lot of sense, given that Obama’s policies did become less severe over time and many of his reforms have been reversed under the Trump administration. But in a race that’s so far been led by Biden, there’s certainly fodder for a rebuke of Obama’s immigration legacy — and it could be a way for candidates like Castro to distinguish themselves in a crowded primary, or perhaps try to push the Democratic Party in a new direction on immigration.