Refactor animtion logic into its own class. AH-351