New features and refactoring

Battery has been added to settings.
Refactoring has been done to reduce number of warnigs.