transfered from docgen