generic interface for map-like data structures