Some refactoring of the timerFactory to get better type information on a debugger.