The embattled chief executive of Uber is out.

Travis Kalanick, the abrasive maverick company head, has stepped down after a bout of investor pressure. The 40-year-old, who will remain on Uber’s board, had presided over a toxic past half year in which the company has been battling accusations of fostering a culture of misogyny and pervasive sexual misconduct.

His departure, first reported by the New York Times, comes shortly after a high-level Uber source told Moneyish that the company is desperate for people to give it a second chance. And it’s making changes internally to make that happen. “There will be new structures in HR so that any complaints are elevated and dealt with very quickly,” the source tells Moneyish. “There are also clear measures to deal with unconscious bias in hiring and recruiting. We have already made symbolic but significant changes.”

The Silicon Valley unicorn that popularized on-demand ride hailing has been flailing. Kalanick— plagued by issues including an incident where he was filmed screaming at a driver— had previously said that he would take a leave of absence. And Uber’s board released a report detailing its moves to reform workplace culture. The efforts however, weren’t helped by a sexist remark made by a board director during a staff meeting about the report, though the prompt resignation of David Bonderman suggests that the company is moving especially quickly to repair its public reputation.

This comes as some evidence emerges that its upstart competitor Lyft is eating into once all-conquering Uber’s market share as customers are turned off by the series of controversies. Uber had a 125% lead in terms of daily app downloads over Lyft last year, a margin that’s since declined to 70%.

Uber’s terrible last six months were triggered by a viral blog post written by former Uber engineer Susan Fowler, who alleged that a manager propositioned her for sex and the company retaliated against her when she complained. Uber has also been dogged by allegations that it tracked users even after they deleted its app, and recently admitted to overcharging customers in New York City.

Among the measures Uber have taken include Kalanick leaving—he’ll be grieving his recently deceased mother and taking personal coaching lessons—and firing Emil Michael, a former top lieutenant to the famously abrasive CEO. The company has tasked Thrive Global founder and CEO Arianna Huffington, a board member, to help reform its frathouse-esque culture and recently hired three senior female executives. The 12,000-employee company will also accept recommendations by external investigators that it limit alcohol consumption at work and prohibit office romances.

This story was updated on June 21, 2017 with news of Uber CEO Travis Kalanick’s departure.