Restructure scheduler.