Replace requestAnimationFrame dependency