Perhaps it’s a sign of the times: In the past, if a network engaged in a messy divorce with one of its top earners, investors might have grown skittish, but Wall Street is endorsing Fox News’ decision to jettison Bill O’Reilly over a series of sexual harassment allegations.

Shares of 21st Century Fox, the news channel’s parent company, climbed in the 24 hours after the sharp-elbowed talk-show host hit the curb, even though his ouster could lead to viewer defections and deprives the network of one of its biggest stars.

“It makes sense to take a near term hit for the benefit of the long-term integrity of the network,” said Anthony DiClemente, an analyst at Nomura Instinet. “We’re in an environment where corporate America realizes we can have zero tolerance for sexual harassment.”

HO’Reilly’s fans may not agree. Throughout the scandal, “The O’Reilly Factor” continued to be a ratings juggernaut. Before dozens of advertisers pulled commercials en masse, the show was contributing an estimated $100 million in ad revenue. Despite the windfall, analysts say O’Reilly represented too great a legal threat to keep on the payroll. His exit comes nine months after Fox News founder Roger Ailes was forced out amid charges he was sexually inappropriate with female staffers, leading Fox brass to promise to clean up the division’s internal culture.

“They’re lowering their legal liability risk every time that they fire one of these sexual harassers,” says Laura Martin, an analyst with Needham & Co. “This is the only appropriate action for any responsible media company to take in 2017.”

It has come at a cost. Fox has paid out $85 million to Ailes, O’Reilly and Gretchen Carlson, the former network anchor who accused Ailes of harassment.

“They’ve done what they need to do to get rid of every man who thinks he’s living in the 1950s and 1960s,” Martin says.

O’Reilly’s brash style gave him a devoted following and made his show the biggest primetime cable program, with an average of 3.98 million viewers. His dismissal could lead to defections. Tucker Carlson, the pugilistic conservative who will fill his slot, doesn’t command the same kind of audience. Yet analysts are skeptical that viewers will turn their back on Fox News, noting that there isn’t another conservative cable news network with the same prominence.

“They’re still going to watch,” says media analyst Hal Vogel. “Their views are best represented in the Fox programming. What are they going to do? Move to CNN or MSNBC?”

There are larger corporate considerations at play. Fox is trying to wrap up its $14.6 billion acquisition of the rest of Sky, the European pay TV company it has longed to own outright. It needs regulatory approval, and can’t run the risk of having the O’Reilly scandal hold up the rubber stamp. Though O’Reilly is worth millions of dollars of revenue, that’s a pittance compared with what Fox stands to make from a satellite-TV service that has 21.8 million customers.

“It makes Fox News less important in the empire, because the empire just got bigger,” Martin says.