more JavaDoc and other minor optimizations