Optimize battery function
More defines
Remove variable ints