Crypto mining firm Core Scientific made a deal with the New York Digital Investment Group (NYDIG) to pay off an outstanding debt of $38.6 million by handing over more than 27,000 mining machines used as collateral. 

In a court filing, the company said the mining rigs were no longer essential to its operations and plans. The firm is now waiting to get the approval of the United States Bankruptcy Court for the Southern District of Texas, which is in charge of the proceedings.

While the company accepted that the move would negatively impact its revenue, Core Scientific highlighted that the long-term benefits of paying off its debt “outweigh the immediate loss.” The crypto-mining firm believes that the transfer is the first step toward becoming more profitable and sustainable.

The firm is also shifting its operations to what it described as a “somewhat smaller, but more efficient” fleet of mining rigs which were in storage and not mining Bitcoin (BTC). The company plans to mitigate some of the losses incurred by the transfer of assets by installing the S19 XP mining rigs, which are not currently in use.

Related: Core Scientific files motion to sell over $6M in Bitmain coupons

The crypto mining company filed for Chapter 11 bankruptcy on Dec. 21. The filing happened months after the company revealed that it was going through financial distress in a filing with the Securities and Exchange Commission. At the time, the company cited increased electricity costs, an increase in the global Bitcoin hash rate, low Bitcoin prices and the Celsius bankruptcy as the reasons for its financial struggles.

On Jan. 31, the bankruptcy court approved the mining company’s plan to borrow $70 million to replace its existing loan. With this, Core Scientific can take out a loan from investment bank B. Riley which is also one of the firm’s creditors.