Refactored animation updating.