[TASK] make it possible to retrieve the type from the document