Improve javadoc comments and formatting