Scheduler framework and more generic code