make manager a state machine