more refactoring of document creation, jobs can be created as well