type field removed from Document
code reworked without @type field