Use requestAnimationFrame for improved performance