rewrite document types