Crackers wither storm mod but as a datapack

Hey guys! I'm a beginner at datapack creation and I have a great idea, remaking the crackers wither storm mod but as a datapack , and my first problem came

How do I optimise the code?

Like my idea is to make the heads teleport to the body every tick and that's a little task intensive , this idea came into my mind because animating stuff in datapacks in practically impossible and Ive taken a huge project

Continue to help post