Exercise equipment manufacturer Peloton Interactive is making big changes to its operations and management. The company announced Tuesday that it would be replacing its chief executive officer, John Foley, and cutting around 20% of its workforce in the U.S.

The company announced that Foley would be replaced by former Spotify and Netflix CFO Barry McCarthy, effective Wednesday. Foley will still remain with the company as its executive chair. Peloton said the decision is a culmination of months of planning.

Peloton's board of directors is also changing, with two new members joining the board. Angel Mendez, a former Cisco executive, and Jonathan Mildenhall, a former Airbnb chief marketing officer, will be joining the company's board. Erik Blachford, who has been on the board of directors since 2015, will be stepping down.

Apart from the change in management, Peloton announced that it plans to reduce its workforce by about 2,800 employees. Foley previously hinted at the workforce reduction last month. Peloton said it also plans to reduce the number of warehouses it owns while also expanding its delivery agreements. The company claimed that the decisions would result in annual savings of around $800 million.

To further cut its costs and save money, Peloton said it would be "winding down the development" of its planned factory in Ohio. Peloton initially announced plans to establish its first U.S. factory, which it said would cost around $60 million.

During its last earnings call, Foley admitted that the company had made a few "missteps," including its hasty expansion and rapid investments in some areas of its business.

The move comes after news broke out that several major companies, including Nike and Amazon, were considering buying out Peloton. There was even news that Apple may be a potential buyer for the embattled company. The new send the company's shares up by more than 20% on Monday following the news.

Since its highs in January last year, Peloton's shares have dropped by more than 80%. The company has been struggling with supply chain issues, multiple recalls, and sluggish demand as the country slowly reopened.

Analysts said that Peloton's latest move might indicate its intention of remaining independent rather than selling itself to another company.

Blackwells Capital, a small activist investor with less than 5% of Peloton's stock, has expressed "grave concerns" about the company's performance and previously asked the board of directors to remove Foley and look into a sale. On Tuesday, Blackwells said the company's announced changes were enough, stating that Foley should not be placed as an executive chair and that he shouldn't have been included in picking the directors.