diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
index 90da4b4..77103f1 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
@@ -80,6 +80,8 @@
 import static org.onosproject.segmentrouting.SegmentRoutingManager.INTERNAL_VLAN;
 import static org.onosproject.segmentrouting.SegmentRoutingService.DEFAULT_PRIORITY;
 
+import static org.onosproject.segmentrouting.SegmentRoutingManager.PSEUDOWIRE_VLAN;
+
 /**
  * Populator of segment routing flow rules.
  */
@@ -539,6 +541,7 @@
         TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder();
         DestinationSet ds;
         TrafficTreatment treatment;
+        DestinationSet.DestinationSetType dsType;
 
         if (destSw2 == null) {
             // single dst - create destination set based on next-hop
@@ -547,18 +550,17 @@
             Set<DeviceId> nhd1 = nextHops.get(destSw1);
             if (nhd1.size() == 1 && nhd1.iterator().next().equals(destSw1)) {
                 tbuilder.immediate().decNwTtl();
-                ds = new DestinationSet(false, false, destSw1);
+                ds = DestinationSet.createTypePushNone(destSw1);
                 treatment = tbuilder.build();
             } else {
-                ds = new DestinationSet(false, false, segmentId1, destSw1);
+                ds = DestinationSet.createTypePushBos(segmentId1, destSw1);
                 treatment = null;
             }
         } else {
             // dst pair - IP rules for dst-pairs are always from other edge nodes
             // the destination set needs to have both destinations, even if there
             // are no next hops to one of them
-            ds = new DestinationSet(false, false, segmentId1, destSw1,
-                                    segmentId2, destSw2);
+            ds = DestinationSet.createTypePushBos(segmentId1, destSw1, segmentId2, destSw2);
             treatment = null;
         }
 
@@ -827,6 +829,7 @@
 
         TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder();
         DestinationSet ds = null;
+        DestinationSet.DestinationSetType dstType = null;
         boolean simple = false;
         if (phpRequired) {
             // php case - pop should always be flow-action
@@ -841,17 +844,15 @@
                 tbuilder.decNwTtl();
                 // standard case -> BoS == True; pop results in IP packet and forwarding
                 // is via an ECMP group
-                ds = new DestinationSet(false, false, destSw);
+                ds = DestinationSet.createTypePopBos(destSw);
             } else {
                 tbuilder.deferred().popMpls(EthType.EtherType.MPLS_UNICAST.ethType())
                     .decMplsTtl();
                 // double-label case -> BoS == False, pop results in MPLS packet
                 // depending on configuration we can ECMP this packet or choose one output
-                if (srManager.getMplsEcmp()) {
-                    ds = new DestinationSet(true, false, destSw);
-                } else {
-                    ds = new DestinationSet(true, false, destSw);
-                    simple = true;
+                ds = DestinationSet.createTypePopNotBos(destSw);
+                if (!srManager.getMplsEcmp()) {
+                   simple = true;
                 }
             }
         } else {
@@ -860,11 +861,10 @@
             tbuilder.deferred().decMplsTtl();
             // swap results in MPLS packet with same BoS bit regardless of bit value
             // depending on configuration we can ECMP this packet or choose one output
-            // XXX reconsider types
-            if (srManager.getMplsEcmp()) {
-                ds = new DestinationSet(false, true, segmentId, destSw);
-            } else {
-                ds = new DestinationSet(false, true, segmentId, destSw);
+            // differentiate here between swap with not bos or swap with bos
+            ds = isBos ? DestinationSet.createTypeSwapBos(segmentId, destSw) :
+                    DestinationSet.createTypeSwapNotBos(segmentId, destSw);
+            if (!srManager.getMplsEcmp()) {
                 simple = true;
             }
         }
@@ -975,6 +975,10 @@
             if (!processSinglePortFiltersInternal(deviceId, portnum, true, INTERNAL_VLAN, install)) {
                 return false;
             }
+            // Filter for receiveing pseudowire traffic
+            if (!processSinglePortFiltersInternal(deviceId, portnum, false, PSEUDOWIRE_VLAN, install)) {
+                return false;
+            }
         }
         return true;
     }
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 360afdd..33c71f5 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -357,11 +357,14 @@
      * Segment Routing App ID.
      */
     public static final String APP_NAME = "org.onosproject.segmentrouting";
-
     /**
      * The default VLAN ID assigned to the interfaces without subnet config.
      */
     public static final VlanId INTERNAL_VLAN = VlanId.vlanId((short) 4094);
+    /**
+     * The Vlan id used to transport pseudowire traffic across the network.
+     */
+    public static final VlanId PSEUDOWIRE_VLAN = VlanId.vlanId((short) 4093);
 
     /**
      * Minumum and maximum value of dummy VLAN ID to be allocated.
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/TunnelHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/TunnelHandler.java
index 1dd845b..7031507 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/TunnelHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/TunnelHandler.java
@@ -222,9 +222,10 @@
             deviceIds.add(config.getDeviceId(sid));
         }
         // For these NeighborSet isMpls is meaningless.
-        DestinationSet ns = new DestinationSet(false, false,
-                                         tunnel.labelIds().get(2),
-                                         DeviceId.NONE);
+        // TODO : Revisit this, the code and also the type
+        DestinationSet ns = DestinationSet.createTypePushBos(
+                                               tunnel.labelIds().get(2),
+                                               DeviceId.NONE);
 
         // If the tunnel reuses any existing groups, then tunnel handler
         // should not remove the group.
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
index 39ac03b..9e28149 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
@@ -984,6 +984,10 @@
                                     .setMpls(MplsLabel.mplsLabel(edgeLabel));
                         }
                     }
+                    if ((ds.getTypeOfDstSet() == DestinationSet.DestinationSetType.SWAP_NOT_BOS) ||
+                         (ds.getTypeOfDstSet() == DestinationSet.DestinationSetType.POP_NOT_BOS)) {
+                        tBuilder.setVlanId(srManager.PSEUDOWIRE_VLAN);
+                    }
                     tBuilder.setOutput(sp);
                     nextObjBuilder.addTreatment(tBuilder.build());
                     treatmentAdded = true;
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DestinationSet.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DestinationSet.java
index e70ec04..3ecdd61 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DestinationSet.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DestinationSet.java
@@ -34,59 +34,52 @@
  * paired-destination switches. May also be used to represent cases where the
  * forwarding does not use ECMP groups (ie SIMPLE next objectives)
  */
-public class DestinationSet {
+public final class DestinationSet {
     public static final int NO_EDGE_LABEL = -1;
     private static final int NOT_ASSIGNED = 0;
-    private boolean notBos; // XXX replace with enum
-    private boolean swap; // XXX replace with enum
     private final DeviceId dstSw1;
     private final int edgeLabel1;
     private final DeviceId dstSw2;
     private final int edgeLabel2;
-
+    private final DestinationSetType typeOfDstSet;
 
     private static final Logger log = getLogger(DestinationSet.class);
 
     /**
      * Constructor for a single destination with no Edge label.
      *
-     * @param isNotBos indicates if it is meant for a non bottom-of-stack label
-     * @param isSwap indicates if it is meant for a swap action
+     * @param dsType type of next objective
      * @param dstSw the destination switch
      */
-    public DestinationSet(boolean isNotBos, boolean isSwap, DeviceId dstSw) {
+    private DestinationSet(DestinationSetType dsType, DeviceId dstSw) {
         this.edgeLabel1 = NO_EDGE_LABEL;
-        this.notBos = isNotBos;
-        this.swap = isSwap;
         this.dstSw1 = dstSw;
         this.edgeLabel2 = NOT_ASSIGNED;
         this.dstSw2 = null;
+        this.typeOfDstSet = dsType;
     }
 
     /**
      * Constructor for a single destination with Edge label.
      *
-     * @param isNotBos indicates if it is meant for a non bottom-of-stack label
-     * @param isSwap indicates if it is meant for a swap action
+     * @param dsType type of next objective
      * @param edgeLabel label to be pushed as part of group operation
      * @param dstSw the destination switch
      */
-    public DestinationSet(boolean isNotBos, boolean isSwap,
-                       int edgeLabel, DeviceId dstSw) {
-        this.notBos = isNotBos;
-        this.swap = isSwap;
+    private DestinationSet(DestinationSetType dsType,
+                          int edgeLabel, DeviceId dstSw) {
         this.edgeLabel1 = edgeLabel;
         this.dstSw1 = dstSw;
         this.edgeLabel2 = NOT_ASSIGNED;
         this.dstSw2 = null;
+        this.typeOfDstSet = dsType;
     }
 
     /**
      * Constructor for paired destination switches and their associated edge
      * labels.
      *
-     * @param isNotBos indicates if it is meant for a non bottom-of-stack label
-     * @param isSwap indicates if it is meant for a swap action
+     * @param dsType type of next objective
      * @param edgeLabel1 label to be pushed as part of group operation for
      *            dstSw1
      * @param dstSw1 one of the paired destination switches
@@ -94,11 +87,9 @@
      *            dstSw2
      * @param dstSw2 the other paired destination switch
      */
-    public DestinationSet(boolean isNotBos, boolean isSwap,
+    private DestinationSet(DestinationSetType dsType,
                           int edgeLabel1, DeviceId dstSw1,
                           int edgeLabel2, DeviceId dstSw2) {
-        this.notBos = isNotBos;
-        this.swap = isSwap;
         if (dstSw1.toString().compareTo(dstSw2.toString()) <= 0) {
             this.edgeLabel1 = edgeLabel1;
             this.dstSw1 = dstSw1;
@@ -110,18 +101,17 @@
             this.edgeLabel2 = edgeLabel1;
             this.dstSw2 = dstSw1;
         }
+        this.typeOfDstSet = dsType;
     }
-
     /**
      * Default constructor for kryo serialization.
      */
-    public DestinationSet() {
+    private DestinationSet() {
         this.edgeLabel1 = NOT_ASSIGNED;
         this.edgeLabel2 = NOT_ASSIGNED;
-        this.notBos = true;
-        this.swap = true;
         this.dstSw1 = DeviceId.NONE;
         this.dstSw2 = DeviceId.NONE;
+        this.typeOfDstSet = null;
     }
 
     /**
@@ -154,21 +144,38 @@
     }
 
     /**
-     * Gets the value of notBos.
+     * Returns the type of this ds.
+     *
+     * @return the type of the destination set
+     */
+    public DestinationSetType getTypeOfDstSet() {
+        return typeOfDstSet;
+    }
+
+    /**
+     * Returns true if the next objective represented by this destination set
+     * is of type SWAP_NOT_BOS or POP_NOT_BOS.
      *
      * @return the value of notBos
      */
     public boolean notBos() {
-        return notBos;
+        if ((typeOfDstSet == DestinationSetType.SWAP_NOT_BOS) || (typeOfDstSet == DestinationSetType.POP_NOT_BOS)) {
+            return true;
+        }
+        return false;
     }
 
     /**
-     * Gets the value of swap.
+     * Returns true if the next objective represented by this destination set
+     * is of type SWAP_NOT_BOS or SWAP_BOS.
      *
      * @return the value of swap
      */
     public boolean swap() {
-        return swap;
+        if ((typeOfDstSet == DestinationSetType.SWAP_BOS) || (typeOfDstSet == DestinationSetType.SWAP_NOT_BOS)) {
+            return true;
+        }
+        return false;
     }
 
     // The list of destination ids and label are used for comparison.
@@ -181,9 +188,10 @@
             return false;
         }
         DestinationSet that = (DestinationSet) o;
+        if (this.typeOfDstSet != that.typeOfDstSet) {
+            return false;
+        }
         boolean equal = (this.edgeLabel1 == that.edgeLabel1 &&
-                            this.notBos == that.notBos &&
-                            this.swap == that.swap &&
                             this.dstSw1.equals(that.dstSw1));
         if (this.dstSw2 != null && that.dstSw2 == null ||
                 this.dstSw2 == null && that.dstSw2 != null) {
@@ -200,26 +208,16 @@
     @Override
     public int hashCode() {
         if (dstSw2 == null) {
-            return Objects.hash(notBos, swap, edgeLabel1, dstSw1);
+            return Objects.hash(typeOfDstSet, edgeLabel1, dstSw1);
         }
-        return Objects.hash(notBos, swap, edgeLabel1, dstSw1, edgeLabel2,
+        return Objects.hash(typeOfDstSet, edgeLabel1, dstSw1, edgeLabel2,
                             dstSw2);
     }
 
     @Override
     public String toString() {
-        String type;
-        if (!notBos && !swap) {
-            type = "default";
-        } else if (!notBos) {
-            type = "swapbos";
-        } else if (!swap) {
-            type = "not-bos";
-        } else {
-            type = "swap-nb";
-        }
         ToStringHelper h = toStringHelper(this)
-                                .add("Type", type)
+                                .add("Type", typeOfDstSet.getType())
                                 .add("DstSw1", dstSw1)
                                 .add("Label1", edgeLabel1);
         if (dstSw2 != null) {
@@ -228,4 +226,129 @@
         }
         return h.toString();
     }
+
+    public enum DestinationSetType {
+        /**
+         * Used to represent DestinationSetType where the next hop
+         * is the same as the final destination.
+         */
+        PUSH_NONE("pushnon"),
+        /**
+         * Used to represent DestinationSetType where we need to
+         * push a single mpls label, that of the destination.
+         */
+        PUSH_BOS("pushbos"),
+        /**
+         * Used to represent DestinationSetType where we need to pop
+         * an mpls label which has the bos bit set.
+         */
+        POP_BOS("pop-bos"),
+        /**
+         * Used to represent DestinationSetType where we swap the outer
+         * mpls label with a new one, and where the outer label has the
+         * bos bit set.
+         */
+        SWAP_BOS("swapbos"),
+        /**
+         * Used to represent DestinationSetType where we need to pop
+         * an mpls label which does not have the bos bit set.
+         */
+        POP_NOT_BOS("popnbos"),
+        /**
+         * Used to represent DestinationSetType where we swap the outer
+         * mpls label with a new one, and where the outer label does not
+         * have the bos bit set.
+         */
+        SWAP_NOT_BOS("swap-nb");
+
+        private final String typeOfDstDest;
+        DestinationSetType(String s) {
+            typeOfDstDest = s;
+        }
+
+        public String getType() {
+            return typeOfDstDest;
+        }
+    }
+
+    /*
+     * Static methods for creating DestinationSet objects in
+     * order to remove ambiquity with multiple constructors.
+     */
+
+    /**
+     * Returns a DestinationSet with type PUSH_NONE.
+     *
+     * @param destSw The deviceId for this next objective.
+     * @return The DestinationSet of this type.
+     */
+    public static DestinationSet createTypePushNone(DeviceId destSw) {
+        return new DestinationSet(DestinationSetType.PUSH_NONE, destSw);
+    }
+
+    /**
+     * Returns a DestinationSet with type PUSH_BOS.
+     *
+     * @param edgeLabel1 The mpls label to push.
+     * @param destSw1 The device on which the label is assigned.
+     * @return The DestinationSet of this type.
+     */
+    public static DestinationSet createTypePushBos(int edgeLabel1, DeviceId destSw1) {
+        return new DestinationSet(DestinationSetType.PUSH_BOS, edgeLabel1, destSw1);
+    }
+
+    /**
+     * Returns a DestinationSet with type PUSH_BOS used for paired leafs.
+     *
+     * @param edgeLabel1 The label of first paired leaf.
+     * @param destSw1 The device id of first paired leaf.
+     * @param edgeLabel2 The label of the second leaf.
+     * @param destSw2 The device id of the second leaf.
+     * @return The DestinationSet of this type.
+     */
+    public static DestinationSet createTypePushBos(int edgeLabel1, DeviceId destSw1, int edgeLabel2, DeviceId destSw2) {
+        return new DestinationSet(DestinationSetType.PUSH_BOS, edgeLabel1, destSw1, edgeLabel2, destSw2);
+    }
+
+    /**
+     * Returns a DestinationSet with type POP_BOS.
+     *
+     * @param deviceId The deviceId for this next objective.
+     * @return The DestinationSet of this type.
+     */
+    public static DestinationSet createTypePopBos(DeviceId deviceId) {
+        return new DestinationSet(DestinationSetType.POP_BOS, deviceId);
+    }
+
+    /**
+     * Returns a DestinationSet with type SWAP_BOS.
+     *
+     * @param edgeLabel The edge label to swap with.
+     * @param deviceId The deviceId for this next objective.
+     * @return The DestinationSet of this type.
+     */
+    public static DestinationSet createTypeSwapBos(int edgeLabel, DeviceId deviceId) {
+        return new DestinationSet(DestinationSetType.SWAP_BOS, edgeLabel, deviceId);
+    }
+
+    /**
+     * Returns a DestinationSet with type POP_NOT_BOS.
+     *
+     * @param deviceId The device-id this next objective should be installed.
+     * @return The DestinationSet of this type.
+     */
+    public static DestinationSet createTypePopNotBos(DeviceId deviceId) {
+        return new DestinationSet(DestinationSetType.POP_NOT_BOS, deviceId);
+    }
+
+    /**
+     * Returns a DestinationSet with type SWAP_NOT_BOS.
+     *
+     * @param edgeLabel The edge label to swap with.
+     * @param deviceId The deviceId for this next objective.
+     * @return The DestinationSet of this type.
+     */
+    public static DestinationSet createTypeSwapNotBos(int edgeLabel, DeviceId deviceId) {
+        return new DestinationSet(DestinationSetType.SWAP_NOT_BOS, edgeLabel, deviceId);
+    }
 }
diff --git a/apps/segmentrouting/app/src/test/java/org/onosproject/segmentrouting/grouphandler/DestinationSetTest.java b/apps/segmentrouting/app/src/test/java/org/onosproject/segmentrouting/grouphandler/DestinationSetTest.java
index 6abf6e3..b41fe07 100644
--- a/apps/segmentrouting/app/src/test/java/org/onosproject/segmentrouting/grouphandler/DestinationSetTest.java
+++ b/apps/segmentrouting/app/src/test/java/org/onosproject/segmentrouting/grouphandler/DestinationSetTest.java
@@ -33,14 +33,13 @@
         d202 = DeviceId.deviceId("of:0000000000000202");
         el201 = 201;
         el202 = 202;
-        ds1 = new DestinationSet(false, false, d201);
-        ds2 = new DestinationSet(false, false, el201, d201);
-        ds3 = new DestinationSet(false, false, el201, d201, el202, d202);
-        ds4 = new DestinationSet(false, false,
-                                 DestinationSet.NO_EDGE_LABEL, d201,
-                                 DestinationSet.NO_EDGE_LABEL, d202);
-        ds5 = new DestinationSet(true, false, d201); // not-bos
-        ds6 = new DestinationSet(false, true, el201, d201); // swap group
+        ds1 = DestinationSet.createTypePushNone(d201);
+        ds2 = DestinationSet.createTypePushBos(el201, d201);
+        ds3 = DestinationSet.createTypePushBos(el201, d201, el202, d202);
+        ds4 = DestinationSet.createTypePushBos(DestinationSet.NO_EDGE_LABEL, d201,
+                                               DestinationSet.NO_EDGE_LABEL, d202);
+        ds5 = DestinationSet.createTypePopNotBos(d201);
+        ds6 = DestinationSet.createTypeSwapBos(el201, d201);
     }
 
     @Test
@@ -80,33 +79,27 @@
 
     @Test
     public void testOneDestinationWithoutLabel() {
-        DestinationSet testds = new DestinationSet(false, false, d201);
+        DestinationSet testds = DestinationSet.createTypePushNone(d201);
         assertTrue(testds.equals(ds1)); // match
 
-        testds = new DestinationSet(true, false, d201);
+        testds = DestinationSet.createTypePopNotBos(d201);
         assertFalse(testds.equals(ds1)); // wrong notBos
         assertTrue(testds.equals(ds5)); // correct notBos
 
-        testds = new DestinationSet(false, false, d202);
+        testds = DestinationSet.createTypePushNone(d202);
         assertFalse(testds.equals(ds1)); //wrong device
 
-        testds = new DestinationSet(false, false, el201, d201);
+        testds = DestinationSet.createTypePushBos(el201, d201);
         assertFalse(testds.equals(ds1)); // wrong label
 
-        testds = new DestinationSet(false, false, -1, d201, -1, d202);
+        testds = DestinationSet.createTypePushBos(-1, d201, -1, d202);
         assertFalse(testds.equals(ds1)); // 2-devs should not match
 
-        testds = new DestinationSet(false, true, d201);
-        assertFalse(testds.equals(ds1)); // wrong swap
-        assertFalse(testds.equals(ds6)); // wrong label
-
-        testds = new DestinationSet(false, true, el201, d201);
+        testds = DestinationSet.createTypeSwapBos(el201, d201);
+        assertFalse(testds.equals(ds1)); // wrong type and label
         assertTrue(testds.equals(ds6)); // correct swap
 
-        testds = new DestinationSet(false, true, DestinationSet.NO_EDGE_LABEL, d201);
-        assertFalse(testds.equals(ds6)); // wrong label
-
-        testds = new DestinationSet(true, true, el201, d201);
+        testds = DestinationSet.createTypeSwapNotBos(el201, d201);
         assertFalse(testds.equals(ds6)); // wrong notbos
     }
 
@@ -114,61 +107,53 @@
 
     @Test
     public void testOneDestinationWithLabel() {
-        DestinationSet testds = new DestinationSet(false, false, 203, d202);
+        DestinationSet testds = DestinationSet.createTypePushBos(203, d202);
         assertFalse(testds.equals(ds2)); //wrong label
 
-        testds = new DestinationSet(true, false, 201, d201);
-        assertFalse(testds.equals(ds2)); // wrong notBos
-
-        testds = new DestinationSet(false, false, 201, d202);
+        testds = DestinationSet.createTypePushBos(201, d202);
         assertFalse(testds.equals(ds2)); //wrong device
 
-        testds = new DestinationSet(false, false, 201,
-                                    DeviceId.deviceId("of:0000000000000201"));
+        testds = DestinationSet.createTypePushBos(201,  DeviceId.deviceId("of:0000000000000201"));
         assertTrue(testds.equals(ds2)); // match
 
-        testds = new DestinationSet(false, false, d201);
+        testds = DestinationSet.createTypePushNone(d201);
         assertFalse(testds.equals(ds2)); // wrong label
 
-        testds = new DestinationSet(false, false, el201, d201, el202, d202);
+        testds = DestinationSet.createTypePushBos(el201, d201, el202, d202);
         assertFalse(testds.equals(ds1)); // 2-devs should not match
     }
 
     @Test
     public void testDestPairWithLabel() {
-        DestinationSet testds = new DestinationSet(false, false, el201, d201, el202, d202);
+        DestinationSet testds = DestinationSet.createTypePushBos(el201, d201, el202, d202);
         assertTrue(testds.equals(ds3)); // match same switches, same order
         assertTrue(testds.hashCode() == ds3.hashCode());
 
-        testds = new DestinationSet(false, false, el202, d202, el201, d201);
+        testds = DestinationSet.createTypePushBos(el202, d202, el201, d201);
         assertTrue(testds.equals(ds3)); // match same switches, order reversed
         assertTrue(testds.hashCode() == ds3.hashCode());
 
-        testds = new DestinationSet(false, false, el202, d202);
+        testds = DestinationSet.createTypePushBos(el202, d202);
         assertFalse(testds.equals(ds3)); // one less switch should not match
         assertFalse(testds.hashCode() == ds3.hashCode());
 
-        testds = new DestinationSet(false, false, el201, d201);
+        testds = DestinationSet.createTypePushBos(el201, d201);
         assertFalse(testds.equals(ds3)); // one less switch should not match
         assertFalse(testds.hashCode() == ds3.hashCode());
 
-        testds = new DestinationSet(false, false, el201, d201, 0, DeviceId.NONE);
+        testds = DestinationSet.createTypePushBos(el201, d201, 0, DeviceId.NONE);
         assertFalse(testds.equals(ds3)); // one less switch should not match
         assertFalse(testds.hashCode() == ds3.hashCode());
 
-        testds = new DestinationSet(false, false, el201, d202, el201, d201);
+        testds = DestinationSet.createTypePushBos(el201, d202, el201, d201);
         assertFalse(testds.equals(ds3)); // wrong labels
         assertFalse(testds.hashCode() == ds3.hashCode());
 
-        testds = new DestinationSet(true, false, el202, d202, el201, d201);
-        assertFalse(testds.equals(ds3)); // wrong not bos
-        assertFalse(testds.hashCode() == ds3.hashCode());
-
-        testds = new DestinationSet(false, false, el202, d202, el201, d202);
+        testds = DestinationSet.createTypePushBos(el202, d202, el201, d202);
         assertFalse(testds.equals(ds3)); // wrong device
         assertFalse(testds.hashCode() == ds3.hashCode());
 
-        testds = new DestinationSet(false, false,
+        testds = DestinationSet.createTypePushBos(
                                     el202, DeviceId.deviceId("of:0000000000000205"),
                                     el201, d201);
         assertFalse(testds.equals(ds3)); // wrong device
@@ -177,39 +162,35 @@
 
     @Test
     public void testDestPairWithoutLabel() {
-        DestinationSet testds = new DestinationSet(false, false, -1, d201, -1, d202);
+        DestinationSet testds = DestinationSet.createTypePushBos(-1, d201, -1, d202);
         assertTrue(testds.equals(ds4)); // match same switches, same order
         assertTrue(testds.hashCode() == ds4.hashCode());
 
-        testds = new DestinationSet(false, false, -1, d202, -1, d201);
+        testds = DestinationSet.createTypePushBos(-1, d202, -1, d201);
         assertTrue(testds.equals(ds4)); // match same switches, order reversed
         assertTrue(testds.hashCode() == ds4.hashCode());
 
-        testds = new DestinationSet(false, false, -1, d202);
+        testds = DestinationSet.createTypePushBos(-1, d202);
         assertFalse(testds.equals(ds4)); // one less switch should not match
         assertFalse(testds.hashCode() == ds4.hashCode());
 
-        testds = new DestinationSet(false, false, -1, d201);
+        testds = DestinationSet.createTypePushBos(-1, d201);
         assertFalse(testds.equals(ds4)); // one less switch should not match
         assertFalse(testds.hashCode() == ds4.hashCode());
 
-        testds = new DestinationSet(false, false, -1, d201, 0, DeviceId.NONE);
+        testds = DestinationSet.createTypePushBos(-1, d201, 0, DeviceId.NONE);
         assertFalse(testds.equals(ds4)); // one less switch should not match
         assertFalse(testds.hashCode() == ds4.hashCode());
 
-        testds = new DestinationSet(false, false, el201, d201, -1, d202);
+        testds = DestinationSet.createTypePushBos(el201, d201, -1, d202);
         assertFalse(testds.equals(ds4)); // wrong labels
         assertFalse(testds.hashCode() == ds4.hashCode());
 
-        testds = new DestinationSet(true, false, -1, d202, -1, d201);
-        assertFalse(testds.equals(ds4)); // wrong mpls set
-        assertFalse(testds.hashCode() == ds4.hashCode());
-
-        testds = new DestinationSet(false, false, -1, d202, -1, d202);
+        testds = DestinationSet.createTypePushBos(-1, d202, -1, d202);
         assertFalse(testds.equals(ds4)); // wrong device
         assertFalse(testds.hashCode() == ds4.hashCode());
 
-        testds = new DestinationSet(false, false,
+        testds = DestinationSet.createTypePushBos(
                                     -1, DeviceId.deviceId("of:0000000000000205"),
                                     -1, d201);
         assertFalse(testds.equals(ds4)); // wrong device
