Deduplicate animation-starting code