Most of this is identical in both branches.  Please move the identical parts out of the branch, and only branch on the job selection.