Refactor timer.