Refactored Animation class