removed duplication between createjob and addqueueentry and reduced it to queueutils.createjob. minor refactorings.