refactor timer.js for a simpler RAF selector