Refactor doc_version