refactor schedule_job for easier unittest, more unittests