diff --git a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
index 877ec30..afd6b2c 100644
--- a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
+++ b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
@@ -213,7 +213,7 @@
     }
 
     /**
-     * Removes basic rules related to a given flow information.
+     * Removes all rules related to a given service VM host.
      *
      * @param host host to be removed
      */
@@ -236,6 +236,11 @@
                     processFlowRule(false, flowRule);
                     continue;
                 }
+
+                PortNumber output = getOutputFromTreatment(flowRule);
+                if (output != null && output.equals(host.location().port())) {
+                    processFlowRule(false, flowRule);
+                }
             }
 
             MacAddress dstMac = getDstMacFromTreatment(flowRule);
@@ -519,17 +524,7 @@
         if (!mastershipService.isLocalMaster(host.location().deviceId())) {
             return;
         }
-
-        for (FlowRule flowRule : flowRuleService.getFlowRulesById(appId)) {
-            if (flowRule.deviceId().equals(host.location().deviceId())) {
-                PortNumber port = getOutputFromTreatment(flowRule);
-                if (port != null && port.equals(host.location().port())) {
-                    processFlowRule(false, flowRule);
-                }
-            }
-
-            // TODO remove the other rules if mgmt network is not in use
-        }
+        // TODO remove management network specific rules
     }
 
     /**
@@ -549,11 +544,11 @@
 
         // for traffics with s-tag, strip the tag and take through the vSG VM
         TrafficSelector selector = DefaultTrafficSelector.builder()
+                .matchInPort(dpPort)
                 .matchVlanId(serviceVlan)
                 .build();
 
         TrafficTreatment treatment = DefaultTrafficTreatment.builder()
-                .popVlan()
                 .setOutput(vSgHost.location().port())
                 .build();
 
@@ -573,11 +568,10 @@
         // lower priority to avoid conflict with WAN tag
         selector = DefaultTrafficSelector.builder()
                 .matchInPort(vSgHost.location().port())
+                .matchVlanId(serviceVlan)
                 .build();
 
         treatment = DefaultTrafficTreatment.builder()
-                .pushVlan()
-                .setVlanId(serviceVlan)
                 .setOutput(dpPort)
                 .build();
 
@@ -585,7 +579,7 @@
                 .fromApp(appId)
                 .withSelector(selector)
                 .withTreatment(treatment)
-                .withPriority(LOW_PRIORITY)
+                .withPriority(DEFAULT_PRIORITY)
                 .forDevice(vSgHost.location().deviceId())
                 .forTable(TABLE_Q_IN_Q)
                 .makePermanent()
