Refactored out transitionEnd