Frustrated iPhone owners have long accused Apple (NASDAQ: AAPL) of artificially slowing down older phones to drive new sales. After years of denials regarding the practice, Apple recently admitted that it was deliberately slowing down older iPhones. The practice only came to light after being discovered by a developer, instead of being clearly disclosed by Apple.

The story began to make the rounds in the news and on social media, damaging Apple’s reputation. The admission resulted in a considerable amount of bad press and multiple lawsuits being filed against the company. Apple has now published a letter to customers apologizing for the “misunderstanding.”

Apple actually insists that it’s never artificially slowed down phones, just aggressively managed phone performance to maximize the lifespan of the batteries. The power management system is intended to prevent unexpected shutdowns of the device. Aging batteries have reduced capacities, and can cause random shutdowns of devices when they are subjected to spikes in power usage.

The company wrote in the open letter published to its website, “Our goal has always been to create products that our customers love, and making iPhones last as long as possible is an important part of that.” The company also denied degrading user experience to encourage upgrades.

Apple says that the iPhone’s power management system analyzes the device’s temperature, battery state of charge, and the battery’s impedance to make a determination to moderate the performance of some system components. This includes slowing down the performance of the CPU and GPU, dimming the screens, lowering maximum speaker volumes, and disabling camera flashes. Apple says the cell radio, GPS, and camera quality aren’t affected.

Apple is offering anyone with an iPhone 6 or later an out-of-warranty battery replacement for $29 starting in late January through December 2018. Replacement batteries typically cost $79. Tests have shown that older devices outfitted with a new battery will see their performance return to normal levels.

Apple has also promised to add features that provide more information about the battery health to iOS in early 2018. The new features will provide users with alerts when their batteries are no longer capable of supporting maximum phone performance.