public void RemoveListener(IListener listener) { var usedIds = listenerBookkeeping[listener]; foreach (var id in usedIds) { DistributionList list = distributionLists[id.Id]; list.RemoveListener(listener); } listenerBookkeeping.Remove(listener); }