What happened 

Investors pushed up the share price of Twilio (TWLO 0.61%), a cloud-based communications software company, this week after the company reported fourth-quarter financial results that easily beat expectations, outpacing Wall Street's average estimates for both its top and bottom lines.

The company's stock also made gains earlier in the week after Twilio's management said that it was significantly reducing its workforce. Altogether, Twilio's shares gained 21.9% this week, according to data provided by S&P Global Market Intelligence.

So what 

Twilio said that its fourth-quarter revenue increased 22% from the year-ago quarter to $1.02 billion, which beat analysts' consensus estimate of $1 billion. Twilio CEO Jeff Lawson highlighted the company's revenue in the quarter in his prepared remarks, saying, "While there are challenges with the current environment, it's a big milestone to cross $1 billion in quarterly revenue."

Investors also focused their attention on the company's bottom line results, in which Twilio's non-GAAP (adjusted) earnings of $0.22 blew past Wall Street's average estimate of a loss of $0.09. Lawson noted that Twilio is "migrating from a growth company to a profitable growth company." 

Investors were clearly happy with the earnings growth in the quarter, but the "path to GAAP profitability" Twilio's management is adopting included cutting the company's workforce by 17% earlier this week. That news came on the heels of previously announced layoffs back in September in which the company eliminated 11% of its jobs.

Now what

Twilio investors appear to be happy with the company's recent moves to focus more on profitability, though they include significantly reducing the company's staff. Twilio's management believes that having fewer employees and restructuring the business into two main segments -- one being communications and the other being data and applications -- will help the company "spend less, streamline, and become more efficient." 

Investors also focused their attention on a $1 billion share repurchase program that Twilio announced and on the company's first-quarter guidance. Twilio's management said that earnings will be $0.20 per share at the midpoint, which is far better than analysts' average estimate of $0.01 per share.  

It's clear after this week that investors are reacting positively to Twilio's moves to focus more attention on profits, and that investors will have to continue keeping a close eye on the company as it tries to shift further in that direction.