Improve javadoc and style