Update to javadoc and code cleanup