refactoring of the tool powerapi done