animation refactoring