Goal: Type the factory so it only accepts a string map and the returned function only accepts valid keys.