Refactored the timer system.