move the logic for getting the JobTable into a separate function