Republican Governor-elect Charlie Baker had the thinnest of needles to thread on his path to the governor's office but somehow he made it work. Here's the five things he did that made the difference:

1. Focus on urban areas and communities of color

Any Republican with an eye on the future of their political party knows that the changing demographics of the United States do not bode well for them over the long haul and Baker was no exception. Republicans can no longer work from a campaign playbook based on an America stuck in 1980 and run out the clock on the white vote. Baker recognized this early on and did everything he could to address it by campaigning extensively in urban Massachusetts.Baker made more than 200 campaign stops in Boston alone and worked hard to build relationships in these crucial communities by connecting with various leaders. More importantly, he went to these places and listened to their concerns instead of just writing them of as inevitable Democratic voters.

"I am campaigning for 100% of the vote" was Baker's common refrain on the campaign trail.

Baker did not win any major urban areas but he did enough in many of them like Lowell to put a dent in the massive margins that Democrats typically run up in cities.

The challenge for Republicans now is building on their meager gains in urban areas for the 2016 and 2018 elections. Coakley won Boston by the smallest margin of victory for a Democrat this decade with just +35 percent, a number that would have probably been lower if it were not for the 1,000 people Boston Mayor Martin J. Walsh's team organized to get people to the polls on Tuesday.

2. An improved get out the vote operation

Baker's 2010 effort was antiquated and out of touch with modern campaigning.

You couldn't just carpetbomb the state with TV ads and run phone banks, you had to get out there and knock on doors. Umpteen successful local Democratic efforts proved that the best way to sway voters, particularly in dense voter rich areas, is to contact them personally. Repeatedly.

Republicans, learning from their endless series of mistakes post-Romney, went about building infrastructure to enable them to run a door-to-door GOTV effort and in a coordinated manner across the ticket.

The party and Baker opened 27 "victory" offices across the commonwealth that were staffed by 2,500 volunteers. Those volunteers made more than 2,500,000 phone calls and knocked on more than 400,000 doors across the state according to the came. Those numbers may seem low for Massachusetts statewide campaigns but for state Republicans they are unprecedented.

State Republicans lack extensive experience in this style of person-to-person campaigning but this campaign appears to have changed all that.

3. An improved relationship with party activists

Rank and file Republican activists speaking privately throughout the campaign said that they thought the party did a much better job this time around distributing resources to down ballot races across the commonwealth, particularly at the legislative level.

These comments from conservative activists are striking given their frequency to bang heads with the party's moderate establishment.

How rile up was the party's activist base? In 2012 they elected a Ron Paul activist straight out of college over Baker to be a Massachusetts delegate to the Republican National Convention. The activist, Evan Kenny, eventually befriended Baker when he helped him with fundraising in his bid for a local school committee race.

4. He was himself

One of Baker's biggest problems in 2010 was that he came across frequently as angry. Baker fed off the national rage that birthed the Tea Party movement and that ultimately damaged his standing with Massachusetts voters.

The Tea Party thing that worked in some parts of the state for the likes of State Rep. Shaunna O'Connell ultimately damaged Baker. His campaign slogan then "Had Enough?" was aimed more at placating bombastic talk radio listeners than it was swing voters in Framingham.

He had to recast himself and be who he is: a likable dorky dad that happens to be really, really smart and somewhat funny.

Baker, like his opponent Attorney General Martha Coakley, had a real image problem going into this election but ultimately he did a better job of correcting it.

5. National help

National pro-Baker forces vastly outspent pro-Coakley forces in this race.

The Chris Christie-led Republican Governors Association spent more money on this race than all the candidates and parties combined. Even more striking is how the Martin O'Malley led Democratic Governors Association did next to nothing to help counterbalance them for Coakley. Democratic operatives have been whispering about this in reporters ears for the last month and a half.

According to a Commonwealth Magazine analysis the RGA was responsible for four out of every five super PAC dollars spent in the race, a staggering sum.

There were points in the race where the RGA was dropping a million-plus dollars a week on the race. Coakley and her allies were overrun and failed to respond with a similar furry.