Refactored out a mockable timer.