Adding GetPowerState command and cleaning up helpers