Extract animation to subroutine
Use more consistent formatting