Refactor timers example