Refactored into indidual functions for the animationhelper