Move scheduling into its own module