This now updates by clearing out old keys (ordered dict approach is probably too much).