refactoring transitionTo