Factor these into their own module so that components other than the scheduler can take advantage of them.