Javadoc and more refactoring