Refactor of the timer.