will lay off 9% of its employees as the company struggles to achieve profitability, while the social-media company’s third-quarter 2016 revenue and earnings exceeded Wall Street expectations.

Twitter said the job cuts will focus primarily on reorganizing its sales, partnerships and marketing operations. The company had 3,910 employees as of the end of September, meaning Twitter is pink-slipping about 350 staffers.

The layoffs come as Twitter showed some slight improvement in financial performance for Q3. The company posted quarterly revenue of $616 million, up 8% year-over-year, and adjusted net income of $92 million, or 13 cents per share. Wall Street expected Twitter to post revenue of $606 million and adjusted EPS of 9 cents. Factoring in stock-based compensation and other items, Twitter’s net loss in the quarter was $103 million, an improvement from a net loss of $132 million in the year-earlier period.

User growth remained stuck in low gear, but slightly exceeded expectations: Monthly active users worldwide hit 317 million for the third quarter, up 3% year-over-year and up by 4 million from 313 million in the previous quarter. Analysts had anticipated a net gain of 3 million.

“Our strategy is directly driving growth in audience and engagement, with an acceleration in year-over-year growth for daily active usage, Tweet impressions, and time spent for the second consecutive quarter,” Twitter CEO Jack Dorsey said in announcing the results. “We see a significant opportunity to increase growth as we continue to improve the core service. We have a clear plan, and we’re making the necessary changes to ensure Twitter is positioned for long-term growth.”

Twitter shares were up more than 5% in premarket trading, after the stock has fallen more than 40% this year.

The news comes after a topsy-turvy month for Twitter on the M&A front. Disney, Google and Salesforce.com were mulling deals to acquire the social player, before each of them backed away from bids.

Disney specifically was reported to be discomfited with the chronic problem of user abuse and hate speech on Twitter, an issue that Dorsey has said is a top priority for the company to address.

Twitter touted encouraging results from its Q3 live-video launches, including NFL’s “Thursday Night Football” games and the Hillary Clinton-Donald Trump debates. Since June, the company has signed more than a dozen live-streaming video partnerships.

The company said that for the first five NFL “TNF” games, total audience has grown on a week-over-week basis, with the most recent three games reaching more than 3 million viewers (although that’s the total number of people who tuned in at some point, not average-minute audience as Nielsen reports TV audiences). During the NFL live-streams, Twitter is averaging 450 million tweet impressions during the broadcast window, which the company said is up substantially over usual volume for pro football games. Up to 15% of the viewers of the NFL games have been non-Twitter users, and the company hopes to convert those to active users.

The second and third Clinton-Trump confrontations averaged 3.3 million unique viewers for the Bloomberg TV feed on Twitter; overall the debates generated an average of almost 3 billion tweet impressions and Twitter hit record daily-user levels in the U.S. during all three debates. But “we really need to have a debate every day on Twitter for it to meaningfully improve the metrics on a quarterly basis,” CFO Anthony Noto said on a call with analysts. “And that’s where we’re headed,” he added, with the company’s live-streaming strategy designed to offer daily tune-in events that give users a reason to spend more time on Twitter.

Twitter says it has started to test a “more personalized” timeline experience for the live-streaming video product, based on users’ interest graphs and a selection of tweets from top influencers.

Dorsey, asked on the Q3 call whether Twitter has any major new initiatives in the pipeline to boost user growth and engagement, responded that the service is “already revolutionary.”

“We’re focused on building the most useful, open, and comprehensive news network on the planet,” Dorsey said. “We’ve been making hundreds of small changes as quickly as we can,” which are yielding continuous usage growth.

With the layoffs, Twitter estimates that it will incur $10 million to $20 million of cash expenditures (mostly severance costs) and $5 million to $10 million of non-cash expenditures, comprising primarily stock-based compensation expense. The company expects to recognize most of restructuring charges in Q4 2016.

As part of the reorg, Twitter is consolidating from three sales divisions to two: It will merge the direct-sales team targeting large brands with its midmarket outbound sales group, with the other sales unit focused on small and midsize businesses. Those changes could affect revenue for the fourth quarter of 2016, Twitter said, and it did not provide a Q4 sales forecast because “there is a wider range of potential revenue outcomes.”

“Sales force transitions can have unexpected impacts when you’re transitioning accounts which is what we’ve seen from other internet companies,” Noto said.