toDictionary and toLookup