Javadoc + small refactoring