move the timer code around