Refactoring and testing timers