AC-6473 cleaned up power state change code.