remove Map.getOrDefault use (not supported in java 7)