rearranged similar code fragments in PowerOffManager