requestAnimFrame refactoring
fixes