What happened early Friday morning, with the collapse of Republican efforts to pass Obamacare reform legislation in the Senate wasn't mostly a story of Sen. John McCain, the maverick. Nor was it a failure of vote whipping or presidential rallying this summer. It was the climax of eight years of failed leadership by Republicans in Congress.

Yes, McCain was characteristically mercurial. Yes, President Trump was disengaged and did little to rev up public opinion. And yes, even the odd 2010 Alaska Senate election, won by Republican Lisa Murkowski, who voted against her party, was relevant. But blame for the Republicans' failure to repeal and replace Obamacare lies mostly at the feet of House and Senate leaders.

The Affordable Care Act passed in March 2010. Republicans immediately promised to repeal it. But they didn't act as though they meant it. The party's leaders brought up many futile repeal bills, but they failed to lay the groundwork for repeal and replacement legislation that might actually pass once President Obama was out of the White House.

The basic task of writing a replacement plan and securing agreement on it was neglected. Many conservative and libertarian healthcare scholars drew up plans, with strengths and weaknesses. Leaders truly dedicated to getting rid of Obamacare would have adopted, debated, hammered out, or improved these plans, and adopted the passable resulting draft.

Alternatively, the House majority beginning in January 2011 and the bicameral majority beginning in January 2015 could have launched the committee process to shape a bill through regular order, instead of just voting on a bill that eliminated the law from the U.S. code. It obviously would have been vetoed by Obama, and even filibustered in the Senate, but legislating an actual replacement bill would have been a productive exercise.

Drafting, debating, and explaining a replacement bill before 2017 would have made it much easier to whip votes this spring and summer. For one thing, centrists such as Sen. Susan Collins, R-Maine, and Murkowski could have come to peace with the crucial principle that they currently reject, that markets can work and should be allowed to work in healthcare.

Convincing House and Senate centrists to back a plan that protected a safety net for the poor and those at high risk, while deregulating markets for everyone else, wouldn't be easy. It would have taken years. But that's the thing: Party leaders had years to do this.

Democrats debated and discussed healthcare reform for years. The details of a plan were the main subject of their presidential debates. They test drove many provisions, such as their "Patients' Bill of Rights," years ago. They laid the groundwork so that their proposals weren't brand new when they arrived on the floor of the House and Senate. Most newer members had run for office under a party whose platform already included these or similar proposals.

The public also needed convincing that health insurance ought to function like insurance, and that most people in most cases should handle healthcare costs like they handle the other costs in their life. This is a bit of a foreign concept, because Obamacare was based on the opposite premise, and before that employer-based insurance meant most professionals did not treat healthcare as though they were consumers.

Pitching a foreign concept about a sensitive topic involves a long, calm, intelligent sales pitch. But Republicans hardly even tried. Not since Ronald Reagan have Republicans had a leader with the will and ability to make a clear, humane, and compelling case for conservative and free-market ideas. It was a lamentable failure — of imagination and political acumen.

Republicans on Capitol Hill didn't do the nuts and bolts work needed for such an ambitious plan as repealing and replacing a law, and the regulatory and funding framework for one-sixth of the economy. In contrast, for example, Democrats began staffing the Congressional Budget Office with friendly experts in 2007. Republicans never thought to do this.

Good prep work would have involved difficult votes and public airing of intraparty disagreements. Avoiding these unpleasantries seemed like the main short-term goal of Senate Majority Leader Mitch McConnell, R-Ky. Winning a majority seemed like the only long-term goal.

Simply opposing Obamacare and avoiding the nasty details may have seemed like good politics at the time. It helped Republicans win unified control of the government for the first time since 2006. A governing majority, however, is supposed to do more than simply deliver the votes to elect a House speaker and a Senate majority leader. Good politics is all for naught if it doesn't deliver good government, which means enacting campaign promises.

So far, Republicans of the 115th Congress have failed. Winston Churchill's father, Lord Randolph Churchill, summarized Benjamin Disraeli's political career as "failure, failure, failure, partial success, renewed failure, ultimate, and complete triumph." One can only hope that after failure, failure, and more failure, the 2017 Republicans can turn around their fortunes in a similar way.