Some cleanup and added lib BatterySensor