doc + refactoring