Cleanup code a bit
Add battery health check