Added support for document types and fields