refactored the animation