refactor power handling