double dictionary lookup. change to a `TryGetValue`