Move keyframe and animation creation to the global scope