Refactoring and slight generalisation of the new Battery feature