refactored change_state action