Refactoring the job status