refactoring of job status