doc_parser refactored