Cleanup of animation code