Shares in electric car maker Tesla Inc. (TSLA) were up over 7% on Wednesday in pre-market trading after the company said it achieved record production of 87,048 vehicles and record deliveries of approximately 95,200 vehicles in the second quarter of 2019, beating analyst expectations by a mile and helping investors forget the disappointing numbers from last quarter.

Over 7,400 vehicles were in transit to customers at the end of the quarter but were not included in the final delivery count. The company saw more orders than deliveries in the quarter, which means it will have a bigger backlog going into Q3.

"In addition, we made significant progress streamlining our global logistics and delivery operations at higher volumes, enabling cost efficiencies and improvements to our working capital position," said the press release on Tuesday. "Global logistics" is something CEO Elon Musk recently said he spent his 48th birthday working on.

Over 80% of production and deliveries were of the company's mass-market Model 3 vehicle. Analysts worry the company is witnessing the cannibalization of its higher-end Model S and Model X by its Model 3.

Tesla shares have fallen around 33% YTD, and its market cap is at approximately $40 billion.

Wedbush analyst Dan Ives called the new records a "rebound" and "feather in the cap” for the company, according to CNBC.

Musk had set expectations high in June when he said to employees in a leaked email, "The reality is that we are on track to set an all-time record, but it will be very close. However, if we go all out, we can definitely do it!" He also reminded potential buyers in June that the U.S. federal tax credit was to drop to $1875 for any Tesla vehicle delivered after the end of the month.

Unfortunately, today's good news comes amid a spate of top executives resigning. Electrek reported on July 1 that Tesla's vice president of production, Peter Hochholdinger, has left to join rival Lucid Motors. Yesterday the website reported vice president of Tesla Europe, Jan Oehmicke, has also exited after a little over a year at the company. Business Insider citing a source has reported vice president of interior and exterior engineering, Steve MacManussays, has also departed the company.