Use a function instead of a Map.