refactor entering new state