Base for all the work on document types