Optimize animation.