Simplify the scheduling code.