Tesla (TSLA) switched things up in its third-quarter financial results. 

The electric carmaker posted an unexpected profit of $1.86 per share on net income of $342 million, compared to Wall Street's consensus forecast of a 42 cent loss.  In after hours trading, shares of Tesla were up 20% as investors digested the results. 

Despite missing expectations on revenue -- sales came in at $6.303 billion, lower than estimates of $6.425 billion -- investors were heartened by the adjusted income and considerable margin improvements that Tesla reported. 

Tesla CFO Zach Kirkhorn pinned the margin improvements on a combination of higher average selling prices for Models S and X, more targeted pricing adjustments, and "just a tremendous amount of good work" in promoting capital efficiency across Tesla's manufacturing, labor, warehousing and logistics.

Its operating margin for the quarter was 4.1%, compared to -2.6% in the prior quarter. Tesla also reported $5.3 billion in cash and cash equivalents for the quarter, including positive free cash flow of $371 million. 

Wall Street analysts interested in learning more about Tesla's financial results had less time for questions than in prior quarters, however. 

Tesla management first fielded questions from a handful of people identified only as institutional investors and retail investors, and discussed a number of topics ranging from what projects CEO Elon Musk is most excited about to its recent acquisition of DeepScale, a startup that focuses on computer vision technology.

"The intent behind what was a very tiny acquisition was to slightly accelerate FSD [full self-driving]," Musk said. He earlier said that Tesla "appears to be on track" to release an early version of that planned feature this year. 

Tesla management briefly addressed demand concerns, a topic that's vexed many investors amid a drawdown in federal EV credits and growing competition. 

"Word of mouth is more than enough to drive demand; we have no plans to advertise," Musk said on the call. Kirkhorn later added that "order rates are strong in all markets." 

Elsewhere, Kirkhorn noted that headwinds may arise in the current quarter from the opening of the Shanghai-based gigafactory, which is in "trial" production of vehicles according to Tesla.