Only an accountant would say that "WTF?" really means "what the heck?"

An accountant whose firm reviewed the financial records of Martin Shkreli's then-drug company Retrophin testified Monday that the company's books were in a "very chaotic" state.

Corey Massella, the accountant, also said at Shkreli's securities fraud trial that he and his employees were "frustrated" when they were repeatedly sent changes in the stock ownership tables of Retrophin as they prepared for the company to go public.

"WTF?" Massella wrote in one email in 2012 after getting the latest change in Shkreli's stock ownership tally.

That tally grew by more than 4,000 shares after Shkreli, who was running Retrophin, was given them by a subordinate, Marek Biestek, in what Shkreli told the accountants vaguely was "for value received," Massella said.

Asked by prosecutor Alixandra Smith what "WTF?" meant, Massella said, "What the heck," during his testimony in Brooklyn, New York, federal court, drawing laughs from others in the courtroom.

Massella said his frustration stemmed from his firm's need to get Retrophin's books in shape for the Securities and Exchange Commission, which had oversight over the company's move to become publicly traded via a reverse merger with a shell company.

Every change in the stock ownership tables, Massella said, took days of work to reflect in other documents.

Prosecutors claim Shkreli, 34, looted Retrophin of stock to pay off investors he had allegedly defrauded at two hedge funds he ran.

"It was very difficult" to get information about Retrophin's financial statements from Shkreli, said Massella, who at the time of his work for Retrophin was a partner in the accounting firm Citrin Cooperman.

"A lot of money flowed out post-merger, and a lot of money had to be" tracked, Massella said.

"There was no documentation on what they were for. They didn't go through payroll."

One item that didn't go through the normal payroll system, Massella said, was a $575,000 transfer from Retrophin to Shkreli's personal bank account.

When Shkreli was asked about it by the accountants, Massella said, Shkreli replied, "Martin's compensation."

In follow-up queries, Shkreli was asked by an employee of Massella's firm why the money wasn't paid through the payroll system, Paychex, why it was much higher than his $250,000 base salary, and what payroll period it applied to.

Shkreli replied that Retrophin did not always use Paychex, and claimed the money included back pay and "bonus pay," Massella said.

Massella said that Shkreli was "not happy" when the accountants asked questions about payments being made to "contractors" and being asked to provide contracting agreements for them, and whether they should instead be classified as employees.

Prosecutors claim that Shkreli used sham Retrophin consulting contracts with defrauded investors at his hedge funds to pay them back money.

Massella said that when his firm started reviewing Retrophin's books in early 2012, the financial information was "very chaotic," with "a lot of very, very small entries" on the books, and "a lot of entries that came from debit cards."

He said the firm found that a lot of entries from Shkreli's debit card on Retrophin's books "were personal in nature" and included items such as iTunes, Starbucks and travel expenses.

Massella said that the only cash control at Retrophin when he began reviewing the books was Shkreli's debit card, and no one was reviewing its use besides Shkreli.

The accountant said it was important to have oversight over the cash expenditures in place to make sure that employees did not misappropriate funds.

Massella said if only one person had control over a company's cash disbursements, that person can do what they want with the account, which can include paying people inappropriately.

Shkreli initially viewed the accountants' concerns as irrelevant and distracting, but eventually agreed to tighten up on oversight over the personal use of the card.

But a year after beginning work for Retrophin, Massella said, his accounting firm flagged a $4,130 expense to Retrophin paid to the Borgata hotel in Atlantic City, New Jersey.

When Shkreli was asked about it, Massella said, he replied, "Martin's trip to Atlantic City."

When the accountants asked Shkreli the purpose of the trip, he replied, "No business, Shkreli to refund to company," Massella said.

Massella said that Citrin Cooperman ended its work for Retrophin in 2013 after receiving abusive emails from Shkreli's sister and Shkreli himself complaining unfairly about the quality of their work.

Joel Cooperman, managing partner at Citrin Cooperman, in his email resigning the firm's work for Retrophin, blasted Shkreli's sister for her "outrageous and rude" email to one accountant, according to testimony Monday.

"He was questioning why we were asking all of these questions," Massella said of Shkreli's attitude toward the accountants.

Additional reporting by Zachary Basu

WATCH: Co-worker says Shkreli 'mentally unstable'