Made map more performant

Use MapBuilder to avoid converting a collection of tuples to a Map.