Generated javadoc and small refactoring.