Factor out duplicated scheduling code.
[Emily, Chris] Fix recently reported calculation.