diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationTypesConnectivity.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationTypesConnectivity.java
new file mode 100644
index 0000000..4e219da
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationTypesConnectivity.java
@@ -0,0 +1,64 @@
+package org.openecomp.sdc.translator.services.heattotosca;
+
+import org.apache.commons.collections.CollectionUtils;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class ConsolidationTypesConnectivity {
+
+  private static Map<ConsolidationEntityType, Set<ConsolidationEntityType>>
+      entityToEntitiesWithoutRelationship;
+
+  static {
+    entityToEntitiesWithoutRelationship = new HashMap<>();
+    entityToEntitiesWithoutRelationship
+        .put(ConsolidationEntityType.COMPUTE, getIgnoredComputeRelationships());
+    entityToEntitiesWithoutRelationship
+        .put(ConsolidationEntityType.PORT,getIgnoredPortRelationships());
+    entityToEntitiesWithoutRelationship
+        .put(ConsolidationEntityType.VOLUME, getIgnoredVolumeRelationships());
+    entityToEntitiesWithoutRelationship
+        .put(ConsolidationEntityType.VFC_NESTED, getIgnoredVfcNestedRelationships());
+  }
+
+  private static Set<ConsolidationEntityType> getIgnoredComputeRelationships(){
+        return Stream.of(ConsolidationEntityType.COMPUTE,
+            ConsolidationEntityType.VOLUME,
+            ConsolidationEntityType.PORT,
+            ConsolidationEntityType.VFC_NESTED).collect(Collectors.toSet());
+  }
+
+  private static Set<ConsolidationEntityType> getIgnoredPortRelationships(){
+        return Stream.of(ConsolidationEntityType.COMPUTE,
+            ConsolidationEntityType.VOLUME,
+            ConsolidationEntityType.PORT,
+            ConsolidationEntityType.VFC_NESTED).collect(Collectors.toSet());
+  }
+
+  private static Set<ConsolidationEntityType> getIgnoredVolumeRelationships(){
+        return Stream.of(ConsolidationEntityType.COMPUTE,
+            ConsolidationEntityType.VOLUME,
+            ConsolidationEntityType.PORT,
+            ConsolidationEntityType.VFC_NESTED).collect(Collectors.toSet());
+  }
+
+  private static Set<ConsolidationEntityType> getIgnoredVfcNestedRelationships(){
+        return Stream.of(ConsolidationEntityType.COMPUTE,
+            ConsolidationEntityType.VOLUME,
+            ConsolidationEntityType.PORT,
+            ConsolidationEntityType.VFC_NESTED).collect(Collectors.toSet());
+  }
+
+  public static boolean isDependsOnRelationshipValid(ConsolidationEntityType source,
+                                                     ConsolidationEntityType target) {
+    Set<ConsolidationEntityType> consolidationEntityTypes =
+        entityToEntitiesWithoutRelationship.get(source);
+    return CollectionUtils.isEmpty(consolidationEntityTypes) ||
+        !consolidationEntityTypes.contains(target);
+
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
index 4e1a60f..d401e49 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
@@ -1164,46 +1164,7 @@
     ConsolidationEntityType sourceEntityType = dependencyEntity.getSourceEntityType();
     ConsolidationEntityType targetEntityType = dependencyEntity.getTargetEntityType();
 
-    //Ignore Compute->Port, Compute->volume, Compute->Compute and Compute->VFC Nested relationships
-    if (sourceEntityType == ConsolidationEntityType.COMPUTE) {
-      if (targetEntityType == ConsolidationEntityType.COMPUTE
-          || targetEntityType == ConsolidationEntityType.VOLUME
-          || targetEntityType == ConsolidationEntityType.PORT
-          || targetEntityType == ConsolidationEntityType.VFC_NESTED) {
-        return false;
-      }
-    }
-    //Ignore Port->Compute, Port->volume, Port->Port and Port->VFC Nested relationships
-    if (sourceEntityType == ConsolidationEntityType.PORT) {
-      if (targetEntityType == ConsolidationEntityType.COMPUTE
-          || targetEntityType == ConsolidationEntityType.VOLUME
-          || targetEntityType == ConsolidationEntityType.PORT
-          || targetEntityType == ConsolidationEntityType.VFC_NESTED) {
-        return false;
-      }
-    }
-
-    //Ignore Volume->Compute, Volume->Volume, Volume->Port and Volume->VFC Nested relationships
-    if (sourceEntityType == ConsolidationEntityType.VOLUME) {
-      if (targetEntityType == ConsolidationEntityType.COMPUTE
-          || targetEntityType == ConsolidationEntityType.VOLUME
-          || targetEntityType == ConsolidationEntityType.PORT
-          || targetEntityType == ConsolidationEntityType.VFC_NESTED) {
-        return false;
-      }
-    }
-
-    //Ignore VFC Nested->Compute, VFC Nested->Volume, VFC Nested->Port and
-    // VFC Nested->VFC Nested relationships
-    if (sourceEntityType == ConsolidationEntityType.VFC_NESTED) {
-      if (targetEntityType == ConsolidationEntityType.COMPUTE
-          || targetEntityType == ConsolidationEntityType.VOLUME
-          || targetEntityType == ConsolidationEntityType.PORT
-          || targetEntityType == ConsolidationEntityType.VFC_NESTED) {
-        return false;
-      }
-    }
-    return true;
+    return ConsolidationTypesConnectivity.isDependsOnRelationshipValid(sourceEntityType, targetEntityType);
   }
 
   private static Map<String, Object> managerSubstitutionNodeTemplateProperties(
