Optimize for $animate and $event