Refactoring BasicDocumentParser