Moves code out of jobmanager init file