Refactoring Animation class