Scientists advance ways to optimize battery energy