Using map allows me to factor out methods that access by key and methods that iterate over all (key, val) tuples into the abstract base class.