Minor refactoring of the timer method.