documentation + refactoring