Despite the heckling of #NeverTrump Republicans and grumbling from purists, President Trump's decision to negotiate with Democrats on the debt ceiling and budget extension is politically wise and a sign of real change under the direction of new White House Chief of Staff John Kelly.

Not only will it help him get his agenda passed, but it will also help Republican Ed Gillespie win a key election for Virginia governor in 2017.

Here was the question facing the Trump administration: Do we fight for the next month over a government shutdown, or do we spend the next month trying to pass tax reform? Clearly, the latter has more potential to help his approval ratings and therefore his ability to pass other agenda items. While conservatives may not mind government shutdowns (in reality, the government never truly shuts down), markets and political moderates aren't big fans. They are big fans, however, of tax reform.

While Trump has signed more than 50 bills into law, he has yet to pass a major legislative initiative that he ran on. He needs to bounce back from the failure of Congress to pass a repeal of Obamacare. Tax reform is his best shot. Even if Congress can't pass anything, Trump will increase his popularity by fighting for popular ideas.

Trump had little to gain with spending and debt negotiations; Republicans have never been able to secure major reforms using shutdowns as a deadline. Could Trump have gotten funding for the southern border wall? Maybe some domestic spending reductions? Maybe, but he was facing resistance from congressional Republicans, and these battles aren't worth the political hit of a shutdown. However, if he passes tax reform, he may be able to pass these other efforts later when he has more political momentum.

Arguing about shutting down the government in the wake of two hurricanes was the wrong battle to pick, and Trump chose correctly. He chose correctly to help himself and the Republican candidates running this November.

Looking back four years ago, it's almost impossible not to admit national Republicans took a hit during the October government shutdown in 2013. It's undeniable that it hurt Republicans' chances in the 2013 Virginia statewide elections, in which they lost all three statewide offices. In the governor's race, former Attorney General Ken Cuccinelli lost to Democrat Terry McAuliffe by 2.5 percent, and Republican State Sen. Mark Obenshain lost to now-Attorney General Mark Herring by just fewer than 1,000 votes.

In Northern Virginia, which is filled with government employees and contractors, Cuccinelli got crushed. Compare his results to the 2009 election. In D.C. suburb Fairfax County, Republican candidate Bob McDonnell won 138,655 votes and won the county. In 2013, Cuccinelli won just 109,585 votes and lost the county by 22 percent.

Certainly, this massive swing wasn't only due to the shutdown, but anyone who lived in Northern Virginia or knocked doors during the election would tell you people were furious at conservatives in Washington. Many Republicans might be proud that government employees were upset at them, but was that pride more important than stopping McAuliffe from becoming governor?

That shutdown accomplished few reforms for Republicans and gave Democrats a 2013 victory.

Jump to 2017, and by most polls, the governors race between Gillespie and Lieutenant Governor Ralph Northam is close. Trump is unpopular in Northern Virginia but remains well-liked in many places downstate. Most analysts would describe Gillespie as fighting against national headwinds due to the Trump administration. If Trump was the fuel behind a government shutdown, it would have been a political bloodbath in Northern Virginia.

Republicans would have lost all three statewide races and many House of Delegates races.

Instead, federal workers and contractors should be grateful to the president for keeping things stable. At a minimum, these voters should be less angry about the current president and more willing to make a fair decision about the 2017 candidates. Gillespie's well-run campaign should help close some of the 2013 gap in Northern Virginia, which could be the margin he needs for a victory.

With Trump making better choices from the Oval Office, this November could be one to celebrate for Republicans. They still have to execute. But by picking the right battles, Trump could get tax reform passed, and Republicans could win in Virginia in 2017.

Ron Meyer (@Ron4VA) is a Washington Examiner columnist and the editor of Red Alert Politics (a sister publication of the Washington Examiner). He's also a supervisor of Loudoun County, Va. (R-Broad Run).