Republican mayors are rare in America’s big cities today. The few surviving ones have tips for getting into and staying in office.

Is the Republican mayor an endangered species? Saying so for sure would be futile, but they are certainly rare in America’s biggest cities these days. Of the nation’s 35 most populous cities, 28 have Democratic mayors and 22 have had them for a very long time.

More strikingly, of the 13 big cities that were led by a Republican mayor at some point in the 21st century, just five still have one.

Indianapolis, which consists of both a city and a county, has elected Republican mayors for 36 out of the last 48 years. Miami, another city-county hybrid, has elected numerous Republicans thanks in part to a longstanding Republican lean among Cuban-Americans. The other three are Fort Worth, Oklahoma City and San Diego.

Observers offer several explanations, but the main one is that the Republican Party’s national brand is considered toxic for voters in diverse, socially liberal cities and suburbs. “The rhetoric I read on the national level worries me,” says Indianapolis Mayor Greg Ballard, a Republican. “As more and more people move to cities, much of our national rhetoric is almost geared toward alienating those populations.”

So how are certain Republicans overcoming rising partisan polarization and getting themselves elected mayor? GOP mayors and experts interviewed for this article offered four tips:

• Take advantage of good fortune. Kevin Faulconer succeeded San Diego Democrat Bob Filner after he resigned amid a sexual harassment scandal. It also worked for Ballard in Indianapolis; he was little-known in 2007 when he launched his first mayoral bid but rode a wave of opposition to new taxes imposed under two-term Democratic Mayor Bart Peterson.

• Promote issues supported beyond the traditonal GOP base. Oklahoma City’s Mick Cornett has been a leader in fighting obesity, while Robert Cluck of Arlington, Texas, “holds some positions on the environment left of most Texas Republicans,” says Mark P. Jones, a Rice University political scientist. Reno, Nev., Mayor Bob Cashell favors same-sex marriage and medical marijuana.

“The city lifestyle is increasingly attractive to more and more people,” says Ballard. This requires a focus on “bike lanes, trails, sustainability, and the artistic, cultural and sports components sought by urban dwellers. These are areas in which Republicans are traditionally weak, but if you want to be a mayor in a large city, you must also focus on these areas.”

• Focus on competence, not ideology. This sounds like moldy old advice, but for mayors it’s particularly important since so much of their job involves ensuring the smooth functioning of basic services, from policing to trash pickup to fixing potholes. “My constituents really don’t care as much about my party affiliation as they do about efficient and caring governance and stewardship,” says Albuquerque Mayor Richard Berry.

• Work your butt off. Ballard “loves getting out into the neighborhoods,” says one political observer in Indianapolis. “He drives his staff crazy by insisting that they schedule all this stuff for him.”