Some code refactoring and added LowPower library.