performance improvement for removeWithKey: