Minor refactoring in job.py