Documentation javadoc and code optimization