On Tuesday, November 8, this 18-month marathon of a presidential race will finally end. And within hours, a new race will begin.

That race will be much shorter—a 73-day sprint to hand over control of the entire federal government from one administration to the next. But it is no less daunting. Every four or eight years, the goal is a smooth presidential transition that minimizes the chances for a national-security catastrophe at a moment of peak vulnerability and maximizes the opportunity for the country’s newly elected leader to deliver on campaign promises during the most important months of any White House term.

For the last eight years, a collection of ex-government officials, good-governance advocates, and lawmakers in Congress have been working to improve presidential transitions. They’re trying to buy the new president extra time by ensuring that on November 8, whoever wins the White House isn’t starting from a dead stop. The United States prides itself on a tradition of a peaceful transfer of power from one administration to the next, no matter the political party. But peaceful doesn’t mean effective, and those who have studied presidential transitions say it is largely through sheer luck that the nation’s historically ad hoc way of installing each successive leader hasn’t resulted in disaster. “You have the most important takeover of any organization in history, and it is done in a dangerous and terrible way,” said Max Stier, the president of the Partnership for Public Service.

The imperative is to begin planning months before the election. A new law requires outgoing administrations to do just that, and President Obama has already named a top aide to coordinate the transition across the government. But the push is also aimed at forcing presidential contenders to begin thinking about governing long before they are done campaigning. They may still be focused on corralling delegates and winning their party nominations, but the preparations for running the government can’t wait until the summer, much less the fall. “It’s a little bit like planning the D-Day invasion,” said Chris Lu, who began secretly working on Barack Obama’s transition around this time eight years ago. “You can’t start planning on the day after Election Day. You have to have a battle plan in place beforehand.”

Joshua Bolten has as much experience as anyone turning on and off the White House lights over the last quarter-century. Bolten is best known as President George W. Bush’s second (and final) chief of staff, and he worked in the White House both at the end of the first President Bush’s administration and at the beginning of his son’s. Before 2008, transitions were largely ad-hoc operations, and except for a few national-security briefings, nothing occurred before the election.

Walking through the offices in the West Wing on January 19, 1993, Bolten remembers it as something of a construction zone, as workers were making modifications requested by the incoming Clinton team. “It’s quite striking that there is nothing on the walls, nothing on the bookshelves, computers on the desks but the hard drives have been replaced,” Bolten told me in a recent phone interview. “The new White House team basically walks onto a blank playing field.”

By the time Bolten returned to the White House as a deputy chief of staff eight years later, the transition process wasn’t much different. The 2001 transition was unexpectedly abbreviated after the monthlong Florida recount, and from a public standpoint, it was memorable mostly for the pranks of junior Clinton staffers who removed the W’s from their computers on their way out the door. “There had been no particular advance in planning or infrastructure,” Bolten said. “The Clinton crew was courteous to us but had not undertaken any particularly strenuous effort to facilitate our effectiveness on Day 1. They just tried to turn it over in responsible condition for us to start our jobs.”

Less than eight months later, on September 11, Bolten was sitting in his office when his phone rang. The inside line. This wasn’t a call routed from his assistant, but from someone who knew the direct number, which, Bolten recalled, even he didn’t know at the time.

The man on the other end was Steve Ricchetti, who had sat at his desk at the end of the Clinton administration. “Do you know about the bunker?” Ricchetti asked.

It turns out, the Bush White House did know about the now-famous emergency command center under the East Wing where the president would later convene his national-security team to plan the 9/11 response. Joe Hagin, another deputy chief of staff, had given top staffers a tour of the bunker shortly after Bush took office. But to Bolten, the fact that his predecessor believed it was possible that the Bush team did not know about such a critical crisis center more than eight months into the presidency was a telling sign about the lack of institutional transition planning.

In 2008, Bush resolved to do things differently, recognizing that, as the president told Bolten in a private meeting about a year before he left office, this would be “the first modern presidential transition at a time when the United States itself was under threat.” Bush told Bolten to make transition-planning a priority and to ensure that not just the White House but the entire government got the message. Years later, it remains one of the few areas for which members of the Obama administration lavish unqualified praise for their predecessors.

“To the credit of the Bush White House, they could not have been better partners with us,” said Lu, who served as executive director of Obama’s transition team and is now deputy secretary of Labor. “The success of the transition planning,” he added, “was in large measure because of the cooperation we got from the Bush White House.”

And while there are plenty of critics of the policies that both administrations put in place in response to the financial crisis, the Bush-Obama handover is considered to be the most successful transition of the modern era. “The 2008 transition was an excellent one,” said Martha Joynt Kumar, who has studied the history of presidential transitions and in 2015 published Before the Oath, a book on the transfer of power from Bush to Obama.

Even as then-Senator Obama was publicly railing against George W. Bush in his bid to win the presidency, senior officials from the Bush administration were meeting in secret with Lu and other members of the Obama team to prepare them to take over the government if they won the election. They were also meeting with advisers to Senator John McCain, sometimes in the same room. In the weeks and months before the election in 2008, the Bush administration sought input from the two campaigns on a new software system for personnel management that the government was planning, and they encouraged both Obama and McCain, the Republican nominee, to submit the names of people who would likely occupy roles on their national-security team so they could have the proper clearance to begin working in the weeks between the election and the inauguration. Knowing that the Democrats would be nervous about turning over names to a Republican administration, Bolten said they set up a system that shielding anyone outside the FBI from knowing whom Obama wanted to have cleared.

Bush may have endorsed McCain, but his advisers now say that Obama was more prepared to take office. While Obama had Lu and John Podesta, a former chief of staff in the Clinton White House, working on transition-planning, McCain was slower to name transition leaders and more reluctant—perhaps out of superstition, officials told me—to submit names to the FBI. “They definitely did not put the same level of attention or organization into constructing a transition team,” Bolten said. “They were behind.”

Obama, by contrast, had quietly tapped Lu to begin working on a transition in May of 2008, before he had even formally defeated Hillary Clinton. “We never told anyone we were doing it. We just kind of did it,” Lu said. He was not officially named the executive director of the transition until the day after the election, even though he had informally held the job for months.

Hannah Lazarte

After the election, the Bush administration focused on preparing the incoming Obama team to take over the national-security apparatus. Bolten persuaded Rahm Emanuel, the incoming chief of staff, to get senior members of Obama’s Cabinet to come to Washington in early January for a table-top exercise with the Department of Homeland Security that simulated a terrorist attack. The planning paid off on Inauguration Day, when officials received word of a “credible” plot to strike the National Mall during the inaugural ceremonies. Bolten had asked Michael Chertoff, the homeland security secretary, to stay in Washington through the inauguration, and Bolten pulled Emanuel out of a ceremonial coffee the Bushes were hosting for the Obamas. The two chiefs of staff went down to the Situation Room and participated in a video conference together.

“Imagine that scene without any planning,” Bolten said.

Ultimately, the inauguration went off smoothly.

While the 2008 transition was considered a success by past standards, history had set a low bar. The Bush and Obama teams understandably focused much of their attention on national security, but the new administration still found itself woefully understaffed across the government as it inherited an economic crisis.

Former administration officials in both parties complain about the lengthy and invasive Senate confirmation process for presidential appointees, which has become so arduous that it discourages skilled people from government service and leaves new administrations short-handed for months. In 2009, the Treasury Department was at the center of Obama’s response to the financial meltdown and economic recession, and while the White House filled political appointee posts in Treasury at a faster clip than other departments and than previous administrations, Secretary Timothy Geithner was still surrounded by empty desks during the most important period of his tenure.

“As well as you prepare, you can’t prepare for the unexpected, and I think that’s the problem,” Lu said. “Obviously if you had known that was going to happen in May 2008, you would have structured your transition in a completely different way. That was just not knowable at that time.”

It wasn’t just the Treasury Department, Lu said, but the entire government that suffered from being short-staffed at the beginning of the Obama administration. After Congress passed the $800 billion economic stimulus package within a month of Obama taking office, it was up to the departments and agencies to disburse the money. And even if there had been enough “shovel-ready” projects across the country, it took the skeleton crews in Washington a while to find them. “At that point in the Department of Labor, there was basically one Senate-confirmed person, and that was the secretary of Labor,” Lu said. “Imagine that in every single agency.”

“People sort of forget that throughout the federal government, there really weren’t a lot of people,” he added.

Obama experienced some of the same hiccups in getting his Cabinet in place as did previous presidents. Geithner’s nomination ran into trouble over tax issues, and two of his other nominees, Tom Daschle and Bill Richardson, were forced to withdraw. Ultimately, Obama succeeded in getting Cabinet secretaries and agency heads confirmed earlier than his predecessors. The main problem, according to Max Stier of the Partnership for Public Service, is that the Obama transition didn’t aim high enough, and it lost momentum after the first wave of appointees were put in place.

The transition had built a team of 300 volunteers to usher in around three dozen top officials. “After that first wave occurred, that group of people—poof!—disappeared,” Stier said. Obama, he said, should have set a goal of getting 100 people confirmed by the time he was inaugurated and 400 by the August recess, which is closer to what Mitt Romney’s team was shooting for had he won in 2012. Studies of the 2009 transition found there was an average of 50 days between the Senate confirmations for agency leaders and the next highest ranking official. “As a result, you end up with agencies where the secretary is home alone,” Stier said. “They don’t have the complete set of people they really need to run the agency effectively.”

The officials who orchestrated the 2008 transition were struck by how much of a fly-by-night operation it was. “We were kind of making it up as we went along,” Bolten recalled.

With help from the Partnership for Public Service, a D.C.-based nonprofit, officials in the administration and in Congress ramped up efforts to formalize the process—to take what worked in 2008 and make it the standard for future transitions. The Partnership had convened a conference north of New York City in 2008 that drew former administration officials, good-government advocates, and representatives of the major campaigns that year. In 2010, it released a report called Ready to Govern with a series of recommendations for transition-planning, including measures that made it into new federal legislation, the Pre-Election Presidential Transition Act of 2010. That law boosted funding for the transition and for the first time authorized the General Services Administration to provide office space to the major-party candidates (and, potentially, a serious third-party contender) to begin planning their governments months before the election. It also allowed the outgoing administration to set up the kind of transition councils that Bush established by executive order in 2008. Recognizing that transition-planning would still be underfunded, however, the law allows campaigns to raise outside money as well.

In 2012, Mitt Romney made use of the new resources—and then some. Running as a management guru and turnaround expert, Romney shook off any concern about appearing presumptuous and named Mike Leavitt, a former Utah governor and Cabinet secretary in the Bush administration, to lead his transition planning soon after he clinched the Republican nomination in the spring.

Unlike four years earlier, Leavitt was charged with coordinating with an administration that his campaign was trying to unseat. When Leavitt spoke to Jack Lew, then the White House chief of staff, he said Lew acknowledged the awkwardness right away—that “we hope there is no transition and you hope there is one.” But Leavitt said Lew and officials throughout the Obama administration conducted themselves professionally. Using the 2008 version as a template, the campaign and the administration signed a memorandum of understanding governing how the transition would go if Romney won the election; it covered things like what kind of access incoming designees would have to information and government office space, how to resolve disagreements, and how to ensure that incoming staffers were properly cleared to handle classified information.

Shortly after the Republican National Convention in late August, Leavitt set up shop in the GSA-provided space in Washington, traveling up to Boston once a week to meet with Romney and only a couple of senior campaign officials for an hour at a time. The limited interaction was by design. “They needed to not be distracted,” Leavitt told me. “Their job was to win the campaign. Mine was to prepare.” The transition created a couple of basic rules. First, it was not going to be a policy laboratory for the campaign. “The campaign made policy, and our job was to prepare to implement it," he said. The second was that no one who worked for the transition was given any guarantee of having a job in an eventual Romney administration. “What I didn’t want was a lot of people trying to position themselves to play a particular role,” Leavitt said. “We were very clear that this was not linked to employment.”

By Election Day, the Romney transition—which had been dubbed the Readiness Project—had swelled to a staff of more than 600. As Leavitt put it: “We had built essentially a federal government in miniature.” The Romney team had set a goal of filling the 150 most important positions by Inauguration Day and a total of 400 by the August congressional recess—an ambitious schedule by historical standards but one that would still leave hundreds of posts vacant for the entirety of President Romney’s honeymoon. (There are more than 4,000 political appointees in the federal government.) By November, Romney, Leavitt, and the transition team had amassed enough material to fill an entire book on the Readiness Project and what-might-have-been, which they published in the spring.

They just didn’t have a government to run. “We built a great ship,” Leavitt said. “We never got a chance to sail it. And it’s a grave disappointment. But somebody has that experience every four years.”

The expectations for the presidential transition are much higher in 2016. Advocates in and out of government have studied the 2008 model, identifying what worked and what didn’t. The Romney campaign performed what amounted to a dry run, and Congress has now passed two new laws codifying the responsibilities of the Obama administration to prepare the government for new leadership. In March, Obama signed legislation requiring the government to set up transition councils, identify agency leaders responsible for transition planning, and to make sure that career civil servants are ready to step in for the hundreds of political appointees who are expected to leave the government before the First Family does. Congress has also enacted legislation reducing the number of positions that require Senate confirmation, a step aimed at helping the new administration get to its feet faster.

The Partnership’s Center for Presidential Transition counts Bolten, Leavitt, and a bipartisan group of other Beltway veterans as advisers. When it launched in January, it published a 200-page guide to presidential transitions that it hopes the current candidates will use as a textbook. The center has hosted a group of about 80 administration officials at its D.C. offices, and it has gotten each of the five remaining campaigns to send a representative to its now traditional election-year conference on the transition process, which is taking place this week in upstate New York. Personnel is the priority—specifically, getting them in place.

“No one has really done this right,” Stier told me. “It is a process that has been done incrementally better over time, and we are in a world of risk that requires a gigantic step-up in the way we hand over the reins of power.”

Administrations have typically focused on getting their Cabinets confirmed, and much less on filling the hundreds of posts below. “That means the agency isn’t fully operational, and the new administration isn’t fully capable of running the government on all cylinders,” Stier said. The beginning of a presidency is a time of maximum political capital—and the worst time to be understaffed. “You lose a year of your administration, and you’ve lost a substantial amount of the time you have to create the change that you promised the American public,” Stier said.

For its part, the Obama administration says it has already begun preparing for the transition, trying to match if not exceed the early timeline set by Bush. Denis McDonough, the White House chief of staff, has assigned one of his senior deputies, Anita Decker-Breckenridge, to oversee the effort, and she has begun meeting with officials across the government “to assemble the materials and the information needed for the transition,” according to White House spokeswoman Brandi Hoffine. “The president was grateful for the time and care put into the transition by President Bush’s team and is committed to ensuring an equally smooth and thorough transition for the next administration,” Hoffine said in a statement.

Hannah Lazarte

The bigger challenge is the campaigns themselves, and whether the pitched nomination battles in each party will allow them to get the early start that advocates believe is necessary. Politics aside, the candidate with the greatest obvious planning advantage is Hillary Clinton. Of the four remaining major contenders, she is the candidate running most explicitly on her governing experience in Washington. Her campaign chairman, John Podesta, turned the White House lights off as Bill Clinton’s chief of staff before running Barack Obama’s transition team eight years later. In a CNN interview in January, Clinton talked up the importance of transition planning.

The earlier we start the better off we’ll be, and we'll get more accomplished. Because I want to really think hard, if I do get the nomination, right then and there, how we organize the White House, how we organize the cabinet, what's the legislative agenda. You know the time between an election and an inauguration is short. You can't wait.

Yet despite her push to focus on transition planning during the campaign, Clinton is plainly not there yet. She remains in a delegate-for-delegate battle with Bernie Sanders for the Democratic nomination, and her campaign would not make Podesta available for an interview. Nor has Donald Trump, the Republican delegate leader, said anything about transition planning. (His campaign did not respond to multiple requests for comment for this article. Spokesmen for Ted Cruz, John Kasich, and Sanders wouldn’t discuss transition efforts, either.) Their silence is understandable on some level: Transition planning at this stage is best done quietly, and Trump’s focus clearly needs to be on holding off Cruz’s bid to wrest away the GOP nomination in Cleveland this July.

At the same time, Trump’s improvisational campaign doesn’t inspire much confidence in the cadre of ex-government officials who want the candidates to prioritize meticulous transition planning. Asked whether they were worried that Trump’s leadership style could make a mockery of a presidential transition, these advocates offered little more than a hope and a prayer—or a tentative appeal to Trump’s business background. “Any nominee who is not prepared to do extensive transition planning lacks a critical component required to be president,” said Leavitt, who has endorsed Kasich for the presidency. As for Trump, Leavitt said: “I assume when he builds a building he hires an architect and a construction manager and that there’s planning that goes in prior to the time that they dig a hole and start putting infrastructure up. I’m sure he will see the value in this and will enable it if he’s the nominee.”

In many respects, the years-long push to perfect the presidential transition is made for a candidate like Clinton, who would enter the White House with all of the insider experience her husband lacked when he moved north from Arkansas in 1992. She clearly wants to avoid the early stumbles that have dogged most recent presidents, and the Center for Presidential Transition is offering her a handy guide to do just that. As a candidate who has snubbed the establishment and flouted received political wisdom at every turn, Trump presents the opposite challenge. Yet the message to both candidates remains pretty much the same: The success of your presidency depends on how you plan for it. Wing it at your own peril.