refactored to use event based timers