renamed request animation frame, refactored