update job state handling
untabify and re-indent