Javadoc changes. Minor refactoring.