Uber laid off 435 workers in its product and engineering teams Tuesday, the second round of cuts in recent months as it struggles to make money.

The job cuts, which total about 8% of Uber’s product and engineering group, follow 400 layoffs in July from the marketing team. In a message to employees about the layoffs Tuesday that was viewed by the New York Times, Uber CEO Dara Khosrowshahi said the company had gone off course as it grew, and it must be streamlined to regain a competitive edge.

The rapid growth “made sense as we worked to scale the business globally and find product-market fit,” Khosrowshahi wrote in the email, which echoed what he said in July. “But at a certain point, bigger teams do not mean better results. It’s critical we get our edge back and continually push ourselves to do better.”

Uber has been under pressure to demonstrate long-term viability. The company had a troubled initial public offering in May as investors questioned its ride-hailing business, which is expensive to operate. Uber’s stock slid below its IPO price on its first day of trading and continues to struggle. In August, it reported a record quarterly loss of $5.2 billion and its slowest revenue growth. The share price rose about 4% on Tuesday.

Khosrowshahi has shaken up Uber’s top ranks and tried to cut costs. After cutting jobs in July, he instituted a hiring freeze and instructed executives to re-evaluate the size of their teams. He pushed out top executives, including his chief operating officer and chief marketing officer. Uber’s board has also seen some turnover.

“Everybody knows that Uber can’t lose billions of dollars a quarter forever, but it’s always been a question of when the money might run out,” said Harry Campbell, a ride-hailing driver and founder of the Rideshare Guy website. “We’ve seen Uber institute a number of cost-cutting measures at the driver and rider level, and now the cuts are coming to the corporate side ... to move towards profitability.”

In his email, Khosrowshahi said he is not making job cuts to appease investors. “We are not doing this for Wall Street. We are doing this for Uber,” he wrote.

Uber faces other labor problems. The Legislature is set to vote this week on a bill that would force Uber to reclassify its drivers as employees rather than as independent contractors. Uber relies on independent contractors as drivers, because by not providing full-time benefits or pay, the company keeps its costs down. Uber and other gig economy companies worked for months to cut a deal with labor groups to remove ride-hail drivers from the bill, but those negotiations failed. The bill is widely expected to pass.

Uber employs more than 27,000 people globally, nearly half in the United States, a company spokesman said. The new layoffs were earlier reported by TechCrunch.

Kate Conger and Mike Isaac are New York Times writers.