typo fixed, imports reorganized, javadoc added for clarification

hello vladimir, did some cosmetic changes and added some javadoc for clarification what usage of protocols is possible