Improve performance of Map lookups by changing keySet to entrySet, and javadoc