Animation refactoring