refactoring animation into its own class