It’s hard to get voters to say they like much of anyone in elected office these days. For many Republicans in Congress, running for re-election in the 2018 midterms is a daunting prospect and a steady stream of retirements has put an exclamation point on the matter.

However, voters still like some of their elected officials — especially, it turns out, Republican governors in blue states. Despite the way partisanship has warped public opinion of countless issues over the last year, competence still counts, and it seems voters are willing to reward leaders who govern well, even if they are of the other party.

It seems so obvious, and yet can’t be stated enough in politics: The best way to overcome a tough political environment? Do a good job. And luckily for Republicans, several GOP blue-state governors are doing just that.

By most measures, the 2018 midterm elections are shaping up to be an ugly affair for the Republican Party. Despite low unemployment and a stock market that keeps hitting new highs, presidential job approval hovers around 40 percent, hardly a figure to celebrate. Data points such as the “generic ballot” — a measure of voter attitudes toward the parties in general — give Democrats a 17 point advantage over Republicans.

But it isn’t just Congress that is up for grabs in the midterms. Governor’s mansions — many of which are inhabited by Republicans — are also on the table, and reporting earlier this week is that Republican operatives are also growing nervous about how their gubernatorial candidates will fare in this political environment. Republicans are defending around two dozen seats, while Democrats are defending fewer than ten.

Just how much trouble are Republicans in on that front? Polling by Morning Consult from late 2017 tested the job approval ratings of every governor in the U.S. and ranked them from most to least popular. Republicans take all ten of the top slots, but also take eight of the ten at the bottom of the list.

Some, like Gov. Sam Brownback in Kansas, proves that being of the “right” political party doesn’t mean much if your state is angry what you’ve done to the state budget.

Former Gov. Chris Christie, whose term expires this week, leaves office with a dreadful approval rating, clocking in at only 18 percent.

But throughout the rest of the Northeast, many Republican governors are soaring. Gov. Charlie Baker in Massachusetts gets a stellar job approval rating of 74 percent, in the same state where President Trump gets just 29 percent approval, according to new polling from WBUR. In second place is Maryland Gov. Larry Hogan, who 61 percent of voters in the state say is doing a good job. In a state where Democrats outnumber Republicans by extraordinary margins, that Hogan retains a seven-point lead in polls asking Maryland voters who they expect to vote for is a feat only possible through his strong record. Govs. Phil Scott of Vermont and Chris Sununu of New Hampshire also get high marks, despite representing states that are hardly “Trump Country” or safe Republican terrain.

For federal races, being able to carefully navigate the Trump Era is a significant challenge. Even if you are a rising star in Congress who has not been shy about criticizing President Trump — the Will Hurds and Carlos Curbelos of the world — you still get tagged with a “votes 96.7% of the time with Trump!” attack, even when most of those votes are fairly anodyne, non-“Trumpy” measures like “extension of government funding for four weeks” or “disaster relief for Puerto Rico,” or are things like voting to table “articles of impeachment against Trump,” which most Democrats don’t even support. Furthermore, your ability to tout your own independent achievements is limited by the challenge of, well, getting Congress to pass something.

Governors can more effectively avoid this mess, especially if the people they serve think they’ve governed well. Govs. Hogan and Baker can point to sub-4 percent unemployment rates in their states. In Nevada, Republican Gov. Brian Sandoval can note that Nevada’s unemployment was four points higher than the U.S. overall figure when he took office, and today is less than a point above it, at just five percent. They don’t have to cast votes “for” or “against” Trump at all, and can talk about the roads and bridges they have built and the programs they have reformed. At the same time, they can’t hide behind the curtain of partisanship if they fail their state; being the Republican governor of a very Republican state like Kansas hasn’t saved Brownback’s approval rating from being dismal.

Republicans are going to be on defense across the country in November. And yes, even those Republicans who are popular should remain vigilant. But the success of so many Republicans in deep-blue territory in the Northeast underscores that governing effectively goes a long way, and that people are willing to give you a thumbs-up even if you’re on the other team, so long as you’re doing your job well. What could be a very ugly November for Republicans may well be less ugly because of the hard work and effective leadership of a handful of blue-state Republicans who are defying the odds.