Lots more work on cleaning up the scheduling