Improving battery quality