Move common timer logic to a separate TimerQueue struct.