Cleanup and improve javadoc