Simplify program structure - use a map.