Refactoring TM-Power Profile Script