clean up the code around power