Chick-fil-A is reinventing itself. @chickfila on Instagram

When Chick-fil-A opened its first New York City restaurant two years ago, police officers gathered outside the three-story building expecting a rash of protests.

The Georgia-based chain, famous for its fried chicken, had ignited a nationwide boycott several years earlier after its founder spoke out against gay marriage.

This was Chick-fil-A's foray into the liberal enclave of Manhattan — part of a larger expansion into the Northeast — and no one was quite sure how New Yorkers would react when it arrived.

But to everyone's surprise there were only a handful of protesters at the restaurant's grand opening. Meanwhile, hundreds of hungry customers waited for hours in a line that snaked down several blocks to get a taste of the chain's food.

Since then, Chick-fil-A has opened two more locations in Manhattan and one in Staten Island, and it has expanded into new states and cities across the US, including Seattle, Portland, Michigan, and Maine.

The company's sales have exploded, from $6.8 billion in 2015 to nearly $8 billion in 2016, marking 49 consecutive years of sales growth, according to Chick-fil-A. Its 2,100 restaurants generated $4.4 million in sales per unit last year, more than any other restaurant chain. By comparison, McDonald's restaurants generated about $2.5 million in per-unit sales last year, and KFC's brought in about $1.1 million per restaurant.

In a few years, Chick-fil-A has managed to shed its controversial image to appeal to a broader swath of America, all without losing its loyal customers base.

'To glorify God'

Chick-fil-A's successful expansion north came after its biggest controversy.

Dan Cathy, the son of the late Chick-fil-A founder S. Truett Cathy, set off a fury among gay-rights supporters in 2012 that led to nationwide protests after he told the Baptist Press that the company was "guilty as charged" for backing "the biblical definition of a family."

After Cathy's remarks, reports emerged detailing Chick-fil-A's many charitable donations to anti-gay-marriage organizations.

For months afterward, protesters rallied outside Chick-fil-A restaurants across the country and held "kiss-ins," where same-sex couples kissed in front of onlookers and TV cameras covering the backlash.

Jim Fortier and Mark Toomajian joined about two-dozen members of gay-rights groups and others protesting outside a Decatur, Georgia, Chick-fil-A restaurant. AP Photo/David Tulis

These days, Chick-fil-A is warning all its franchisees against speaking out publicly or getting involved in anything that could blur the line between their private beliefs and their public roles as extensions of the Chick-fil-A brand, the company has said.

Last year, that message extended to politics, in part to keep the brand from being exploited by candidates. The company turned down several candidates who tried to use Chick-fil-A to bolster their campaigns, according to David Farmer, Chick-fil-A's vice president of menu strategy and development.

"There are several candidates who would like to use us as a platform," Farmer told Business Insider last year. "We are not engaging. Chick-fil-A is about food, and that's it."

The company still encourages its franchisees to get "entrenched" in their communities. Operators' involvement in their communities is a critical part of what has helped Chick-fil-A attract a passionate following.

Traditionally, that has meant getting involved in local churches. But Chick-fil-A says its focus now — both for local and corporate involvement and philanthropy — is on youth and education causes.

S. Truett Cathy, founder of Chick-fil-A (second right), with son Dan T. Cathy (far left), daughter Trudy White, and son Donald "Bubba" Cathy. AP

The company's corporate purpose, which is displayed prominently on its website, still reflects its founder's Christian faith: "To glorify God by being a faithful steward of all that is entrusted to us and to have a positive influence on all who come into contact with Chick-fil-A."

Chick-fil-A locations all remain closed on Sundays. The company attributes this tradition to Truett Cathy on its website: "Having worked seven days a week in restaurants open 24 hours, Truett saw the importance of closing on Sundays so that he and his employees could set aside one day to rest and worship if they choose — a practice we uphold today."

While still practicing some of the Cathy's faith-based traditions, Chick-fil-A is trying to push a more inclusive message. The company said it has told its operators not to let their activities in the community alienate or exclude any particular faiths or religious organizations.

"We want Chick-fil-A to be for everyone," Farmer said in an interview last year, recalling a message told to franchisees. "That's your filter when deciding what to engage in."

'It requires heroic leadership'

Chick-fil-A's cultural reinvention hasn't been without setbacks. Over the years, protesters have tried — and sometimes succeeded — to quash proposals to build new restaurants.

As recently as May, Fordham University in New York denied the chain's proposal to build a restaurant on campus because of backlash from student groups supporting LGBTQ rights.

But the chain has been largely successful in changing its image, something that's nearly impossible to achieve, according to Mark Cohen, a professor at Columbia Business School and the former CEO of Sears Canada.

"Most companies that get into trouble never get out of trouble," Cohen told Business Insider. "It requires heroic leadership, and usually that leadership has to be brand new."

Chick-fil-A had a change in leadership in 2013, when Truett Cathy retired from his roles as chairman and CEO of the company at age 92. His son Dan took over.

After the younger Cathy became CEO, Chick-fil-A started modernizing its corporate offices in Atlanta and opened an "innovation center" modeled after the offices of Silicon Valley tech companies, including HP Labs, Apple, and Pixar.

The company hired chefs, food scientists, and dietitians to work in its innovation center. Hayley Peterson

The company also hired Ford Fry, an Atlanta restaurateur and a James Beard Award-nominated chef, as a consultant for menu development to help Chick-fil-A appeal to upmarket, health-conscious customers who frequent chains like Shake Shack and Panera.

One of the products has been the "superfood side" that has kale, broccolini, and roasted nuts.

So as the company has shifted its cultural compass away from churches and toward schools, it has pivoted toward a more "premium" image. "We still view ourselves as fast food because of our drive-thrus, but we're premium fast food," Farmer said.

Winning customer service

Key to Chick-fil-A's reinvention has been its customer service, which consistently ranks No. 1 in nationwide surveys. Highly regarded customer service is uncommon in fast food, an industry notorious for paying low wages.

Chick-fil-A doesn't pay much more than the industry average, at least according to the wage-tracking site Glassdoor. The company pays its restaurant employees about $8.45 an hour, just 20 cents more than the industry average of $8.25 per hour.

Chick-fil-A says it is investing in employees in other ways, though, whether it's through training programs or tuition assistance. The company says it encourages franchisees to ask new hires what their career goals are and then to try to help them achieve them, whether or not their aspirations are rooted in the fast-food industry.

Chick-fil-A consistently ranks No. 1 in nationwide surveys for customer service. YouTube/The Texting Yoga Pants

For Kevin Moss, a Chick-fil-A manager of 20 years, supporting his team has meant funding an employee's marketing degree and paying for another worker to take photography classes.

Moss told Business Insider he also tries to support his employees in times of need. If an employee's family member is in the hospital, he will send food to the family and hospital staff. "I've found people are more motivated and respond better when you care about them," Moss said.

Another franchisee, Jamie Ochsner, gives employees enrolled in high school or college bonuses of up to $250 per semester for every A or B grade they get. Many franchisees offer training classes for employees to earn certificates in managing food and labor costs and managing conflict in restaurants.

"The better we train, the longer people stay with us," Moss said.

Chick-fil-A invests in rigorous training programs for its employees and offers perks like tuition assistance. Chick-fil-A According to Cohen, it's Chick-fil-A's investment in its employees that has been the linchpin to its successful reinvention.

"Your employees are your ambassadors to the public," Cohen said. "The folks who are staffing those Chick-fil-A stores are aggressively reengaging with people and talking about how great the company is."