refactoring + javadoc