doc manager rewrite