Use pointers to maps.
Simplify code.