move animation loop to helpers