You can replace this with a direct call to `ToDictionary()`.