Javadocs and refactoring