This file would be easier to read if you move this method up above the first call to it, so before set_job_status.