Changes to new document generation