Animation code cleanup