New document-based version