refactoring; turn PowerOffManager into a component; make code a little more concise