Refactored the document_detail