refactor of postjob()