Senator Bernie Sanders (I-VT) Jay LaPrete | AFP | Getty Images

On three separate occasions this July, staffers for Sen. Bernie Sanders (I-VT) began preparing for the rollout of his new single-payer health care bill. But every time they started to do so, Senate Republicans would improbably revive their push to repeal Obamacare — and Sanders's team would postpone the launch of their "Medicare-for-all" campaign, according to aides to the Vermont senator. "Bernie has repeated to us over and over and over again, 'Our top priority is doing everything in our power to make sure 20 million people don't lose their health care,'" said Ari Rabin-Havt, a senior adviser to Sanders. More from Vox:

Robert Mueller's Russia investigation, and why Trump is so afraid of it, explained

The opioid epidemic, explained

The Trump administration's new war on affirmative action, explained This was something of a relief to some Democrats. Just last year, the party warily eyed Sanders as a potential liability as much as a potential ally. After all, he has repeatedly insisted that Obamacare was, at best, a way station on the road to single-payer. "Obamacare was a small victory for the uninsured, but it is time to take the fight against inadequate coverage even further," he said. After the election, some feared the Vermont independent would continue to torch Obamacare's inadequacies, while turning his passionate followers against the Democratic Party. But at least during the Obamacare repeal fight in Congress, Sanders was a team player. He brought crowds to dozens of rallies with Senate Democrats who had once opposed him. He shut a Republican attempt to expose Democrats' divisions, despite the interest of some of his team. And, perhaps most importantly, he marshaled his resources and newfound star power in defense of Democrats' top priority: showing what it might look like for his movement to be incorporated into the party apparatus, rather than having it try to knock down its gates. "Our job today is to defend the Affordable Care Act," Sanders said at several of his rallies this year. "Our job tomorrow is to create a Medicare-for-all single-payer system."

Sanders's rallies with Democrats kick off a campaign to save Obamacare

The Vermont senator's defense of the law didn't come out of nowhere. In the early evening hours of December 9, 2016, roughly a dozen Sanders staffers crowded around a conference table in room 332 of the Dirksen Senate Office Building. It was one of their first strategy meetings since the election. Sanders told them that they were being tasked with getting "out in front" of Republicans' health care agenda, according to aides who attended the meeting. At that point, nobody knew what Senate Majority Leader Mitch McConnell would propose — or if he'd propose anything at all. Sanders said he wanted the assembled aides, including his chief of staff and senior aides, to preemptively plan on holding health care rallies in states across the country focused on defending the Affordable Care Act. Sanders's team left the meeting baffled by the request. One wondered how they were expected to draw crowds to rallies over an unknown bill. "We walked out of it and said, 'How are we going to do this? This is crazy,'" one recalled. They started in the freezing cold. On January 15, as temperatures hit the low teens, Sanders joined Senate Minority Leader Chuck Schumer (NY) and Michigan Sens. Debbie Stabenow and Gary Peters onstage at Macomb County Community College. Eight thousand people showed up. "Sanders knew he had a unique megaphone in American politics, and he used it to shout it at the top of his lungs at a time when few were paying attention to the health care fight," said Ben Wikler, Washington director of MoveOn.org. He kept shouting. In Portland, Maine, long before Sen. Susan Collins (R-ME) proved a crucial health care "no" vote, about 1,000 people watched Sanders decry the bill. After his favored candidate lost the contentious race to lead the Democratic National Committee, Sanders led aneight-state, 6,000-mile tour with new DNC Chair Tom Perez to kill "Trumpcare." For two days in June, his team and its gray van traveled 348 miles in Appalachia to build public opposition to the Republican health bill. Activists say that proved a crucial step in showing Democratic lawmakers that the public would join them in fighting for the ACA. "There were thousands of people at these rallies — in state after state after state after state. It was transformative for Democratic senators to see," said Wikler. "They learned that people will show up, even in the bitter cold, to fight for the Affordable Care Act — which had once been written off as an unpopular and potentially doomed chunk of the Obama legacy."

Resisting the single-payer temptation

As the debate over the Senate Republican bill stretched from one month to four, and then from four months to seven, Sanders resisted the temptation to make his whirlwind tour across the country primarily about single-payer health care. "Throughout this whole thing, there was always the temptation to pivot to make a stronger case for Medicare-for-all, rather than keeping the ACA at the center of our focus," one aide recalled. "Bernie always insisted to us: 'No, no, no.'" In March, Sanders was already promising to "soon" announce his single-payer bill. It still hasn't been released. Republicans even tried to force the single-payer out of him. On July 26, Sen. Steve Daines (R-MT) announced he would introduce a single-payer amendment in an upcoming vote-a-rama that he himself opposed. Daines's amendment was an attempt to splinter the Democratic caucus, thereby exposing the minority party's divisions on how to reform the health care system. At least some members of Sanders's team saw it as a golden opportunity. "There were definitely people — both inside and outside our office — who were saying, 'This is it! This is what we've been waiting for!'" one Sanders aide said. After speaking with Schumer, Sanders himself shut down the idea, telling his staffers that they would not be going along with Daines's gambit. Sanders and all but five Democratic senators abstained from the vote, and the story was quickly buried. "Bernie's instinct immediately was to say, 'We're not going to engage on this,'" according to the aide.

Using Sanders's movement to defend Obama's legacy

As Sanders barnstormed across the country to defend Obamacare, his rallies looked like a new fusion in the party — partly the Sanders faithful, but they were complemented by organizations and voters who had been faithful to Hillary Clinton too. About 10 minutes after Sanders concluded one speech in downtown Pittsburgh in late June, Jared McCray and his sister remained behind the crowd. They looked out at the empty stage where Sanders had just stood. "This is about people's lives," said McCray, echoing a line from Sanders's speech. Both had refused to support Clinton in the general election. "We have no regrets" about sitting out the election, said McCray, 24, a touch defensively. A few feet away from them stood Dean Ofran, 54. A lifelong Pittsburgh resident, Ofran had voted for Clinton in the primary, though he said he harbored no animus toward the Vermont senator. "Of course I support single-payer — the primary wasn't about that," Ofran said. "I just didn't think he could beat Trump. I still don't think he could." It was a similar story in West Virginia. In the crowd in Charleston, two young men — Sean McAllister, 18, and Sean Hill, 17 — said they both cast write-in ballots for Sanders in the general election. Though they wouldn't vote for Hillary Clinton, they had showed up to a rally to defend Obamacare, in part because they feared the impacts of the Republican bill's Medicaid cuts. The "Bernie or Bust" voters who wouldn't defend President Barack Obama's legacy against Trump last November now, suddenly, were. "I've been trying to persuade my mom that she was misled by Trump and that Bernie wouldn't betray her like this," Hill said. The work behind the scenes also reflected how Sanders's tour for Obamacare patched up the old party divisions, at least temporarily. On the ground, Sanders's campaign helped endear him to local Democrats who once implacably opposed his candidacy. "There were a significant number of Clinton people who were there," said Joe Meyer, the mayor of Covington, in an interview about a Sanders rally in his city. "They certainly didn't stay home — and I think that tells you something. It shows the appeal of the message and the substance of the issue." In late February, Sanders spoke at a dinner of the Kansas Democratic Party. He appeared onstage not just with Schumer and Stabenow, both of whom endorsed Clinton, but with Tom Perez and other Clinton backers such as Sens. Chris Van Hollen (MD), Kamala Harris (CA), Kirsten Gillibrand (NY), and Chris Murphy (CT). Planned Parenthood endorsed Clinton in the primary, leading to an ugly public rift with Sanders in January 2016. But during the Obamacare fight, the two were closely allied. Planned Parenthood president Cecile Richards appeared with Sanders and Perez at a rally in Nevada, and Planned Parenthood volunteers stood alongside Sanders's supporters at events around the country. In last Thursday's rally outside the Capitol, Sanders returned the favor and specifically thanked Richards and Planned Parenthood — another sign that the party's internal grievances had been patched up, at least as long as Senate Republicans' bill hung overhead.

Sanders's movement is becoming the Democratic Party