Simplify the document id retrieval