separate timer code