refactoring + isDef + doc