javadoc and comments improved and protocol check made more performant