Refactor hooks in animation-constructor to use a helper method.

This saves a whopping 260B.