Refactored the animation