Extract run_timed_tasks helper method