Index: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/data/WindowTree.java
===================================================================
--- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/data/WindowTree.java	(revision 171)
+++ trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/data/WindowTree.java	(revision 172)
@@ -98,5 +98,4 @@
 	 *            class name of the window to be created
 	 */
-	@SuppressWarnings("unchecked")
 	public void add(int parentHwnd, int childHwnd, String childWindowName,
 			int resourceId, String className, boolean isModal) {
@@ -114,21 +113,5 @@
 		}
 
-		// store targets in GlobalDataContainer to be able to work on with them
-		// in DlgInsert
-		List<String> treeTargets = new ArrayList<String>();
-
-		if (GlobalDataContainer.getInstance().getData("ListTargets") == null) {
-			GlobalDataContainer.getInstance().addData("ListTargets",
-					treeTargets);
-		}
-
-		try {
-			treeTargets = (List<String>) GlobalDataContainer.getInstance()
-					.getData("ListTargets");
-		} catch (ClassCastException e) {
-			Console.println("Not able to cast data in GlobalDataContainer to List of Strings");
-		}
-
-		treeTargets.add(nodes.get(childHwnd).xmlRepresentation());
+		storeTarget(childHwnd);
 	}
 
@@ -185,3 +168,31 @@
 		return nodes.size();
 	}
+
+	/**
+	 * <p>
+	 * Stores a targets in GlobalDataContainer to be able to work on with it in
+	 * DlgInsert
+	 * </p>
+	 * 
+	 * @param hwnd
+	 *            hwnd of the window to be stored
+	 */
+	@SuppressWarnings("unchecked")
+	private void storeTarget(int hwnd) {
+		List<String> treeTargets = new ArrayList<String>();
+
+		if (GlobalDataContainer.getInstance().getData("ListTargets") == null) {
+			GlobalDataContainer.getInstance().addData("ListTargets",
+					treeTargets);
+		}
+
+		try {
+			treeTargets = (List<String>) GlobalDataContainer.getInstance()
+					.getData("ListTargets");
+		} catch (ClassCastException e) {
+			Console.println("Not able to cast data in GlobalDataContainer to List of Strings");
+		}
+
+		treeTargets.add(nodes.get(hwnd).xmlRepresentation());
+	}
 }
