Index: /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 2411)
+++ /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 2412)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.trn;
 
@@ -15,4 +15,5 @@
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.Map.Entry;
@@ -101,7 +102,7 @@
         // is exactly one way that all nodes are part of.
         if (selectedWay == null && selectedNodes != null) {
-            HashMap<Way, Integer> wayOccurenceCounter = new HashMap<Way, Integer>();
+            Map<Way, Integer> wayOccurenceCounter = new HashMap<Way, Integer>();
             for (Node n : selectedNodes) {
-                for (Way w : getCurrentDataSet().getWays()) {
+                for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {
                     if (!w.isUsable()) {
                         continue;
@@ -294,5 +295,5 @@
         // now copy all relations to new way also
 
-        for (Relation r : getCurrentDataSet().getRelations()) {
+        for (Relation r : OsmPrimitive.getFilteredList(selectedWay.getReferrers(), Relation.class)) {
             if (!r.isUsable()) {
                 continue;
Index: /trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 2411)
+++ /trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 2412)
@@ -67,9 +67,6 @@
         if (checkSelection(selection)) {
             int count = 0;
-            for (Way w : getCurrentDataSet().getWays()) {
+            for (Way w : OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {
                 if (!w.isUsable() || w.getNodesCount() < 1) {
-                    continue;
-                }
-                if (!w.containsNode(selectedNode)) {
                     continue;
                 }
@@ -92,9 +89,6 @@
             for (Node n : selectedNodes) {
                 int count = 0;
-                for (Way w : getCurrentDataSet().getWays()) {
+                for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {
                     if (w.isDeleted() || w.incomplete || w.getNodesCount() < 1) {
-                        continue;
-                    }
-                    if (!w.containsNode(n)) {
                         continue;
                     }
@@ -189,12 +183,5 @@
         if (!(n instanceof Node))
             return false;
-        boolean isPartOfWay = false;
-        for (Way w : getCurrentDataSet().getWays()) {
-            if (w.containsNode((Node) n)) {
-                isPartOfWay = true;
-                break;
-            }
-        }
-        if (!isPartOfWay)
+        if (OsmPrimitive.getFilteredList(n.getReferrers(), Way.class).isEmpty())
             return false;
 
@@ -320,5 +307,5 @@
         Relation newRel = null;
         HashSet<String> rolesToReAdd = null;
-        for (Relation r : getCurrentDataSet().getRelations()) {
+        for (Relation r : OsmPrimitive.getFilteredList(originalNode.getReferrers(), Relation.class)) {
             if (r.isDeleted() || r.incomplete) {
                 continue;
@@ -365,9 +352,6 @@
             boolean firstway = true;
             // modify all ways containing the nodes
-            for (Way w : getCurrentDataSet().getWays()) {
+            for (Way w : OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {
                 if (w.isDeleted() || w.incomplete || w.getNodesCount() < 1) {
-                    continue;
-                }
-                if (!w.containsNode(selectedNode)) {
                     continue;
                 }
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 2411)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 2412)
@@ -773,5 +773,5 @@
     public Way getWayForNode(Node n) {
         Way way = null;
-        for (Way w : getCurrentDataSet().getWays()) {
+        for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {
             if (!w.isUsable() || w.getNodesCount() < 1) {
                 continue;
Index: /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2411)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2412)
@@ -753,24 +753,4 @@
     }
 
-    public Set<Relation> getReferringRelations(Collection<? extends OsmPrimitive> primitives) {
-        return this.getReferringRelations(new HashSet<OsmPrimitive>(primitives));
-    }
-    public Set<Relation> getReferringRelations(Set<? extends OsmPrimitive> referred) {
-        HashSet<Relation> ret = new HashSet<Relation>();
-        if (referred == null) return ret;
-        referred.remove(null); // just in case - remove null element from primitives
-        for (Relation r: relations) {
-            if (r.isDeleted() || r.incomplete) {
-                continue;
-            }
-            Set<OsmPrimitive> memberPrimitives = r.getMemberPrimitives();
-            memberPrimitives.retainAll(referred);
-            if (!memberPrimitives.isEmpty()) {
-                ret.add(r);
-            }
-        }
-        return ret;
-    }
-
     /**
      * Reindex all nodes and ways after their coordinates were changed. This is a temporary solution, reindexing should
