refactor DocManager