Refactoring transition and fadeTransition