Minor refactoring of job script.