little javadoc and code refactoring