small cleanup in state_machine