iOS 13 could help keep your iPhone battery from aging too quickly due to overcharging, thanks to a new feature hidden away in the raft of new updates.

Apple came under fire for lowering CPU speeds on iPhones with older batteries during the end of 2017. $29 battery replacements were offered as an apology. Now it appears that Apple has come up with another novel solution to ease battery woes.

The new feature wasn’t mentioned during Apple’s epic WWDC keynote yesterday, but optimized battery charging is mentioned on the iOS 13 list of all new features.

Optimized battery charging is described as a new option that “helps slow the rate of battery aging by reducing the time your iPhone spends fully charged. iPhone learns from your daily charging routine so it can wait to finish charging past 80% until you need to use it.”

iPhones already have battery management systems that fast charge the device to 80% and then trickle charge the rest. The new feature adds a machine learning element to that though so it’s not needlessly charging at 100%.

You can choose to enable or disable optimized battery charging depending on your preferences. While the feature sounds great for people that have a set routine, it may cause some headaches if it’s enabled while traveling or if you’re going to be waking up earlier than normal.