More flexible battery

This should be easier now to work with more different hardware and different possibilities.