Replace some code with maps and sets for primitive data types