diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java
index a0ea5c9..b6d64d2 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java
@@ -75,7 +75,7 @@
 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.isOperationInputMappedToComponentInput;
 import static org.openecomp.sdc.be.components.utils.PropertiesUtils.getPropertyCapabilityFromAllCapProps;
 import static org.openecomp.sdc.be.components.utils.PropertiesUtils.isCapabilityProperty;
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.SELF;
+import static org.openecomp.sdc.be.tosca.InterfacesOperationsConverter.SELF;
 
 @Component("interfaceOperationBusinessLogic")
 public class InterfaceOperationBusinessLogic extends BaseBusinessLogic {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
index c1f7808..ba04c00 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
@@ -167,7 +167,7 @@
 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.getOperationOutputName;
 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.isOperationInputMappedToOtherOperationOutput;
 import static org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum.UPDATE_SERVICE_METADATA;
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.SELF;
+import static org.openecomp.sdc.be.tosca.InterfacesOperationsConverter.SELF;
 import static org.openecomp.sdc.be.types.ServiceConsumptionSource.SERVICE_INPUT;
 import static org.openecomp.sdc.be.types.ServiceConsumptionSource.STATIC;
 
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java
index c02eb28..b462149 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java
@@ -30,6 +30,7 @@
 import org.openecomp.sdc.be.model.tosca.ToscaFunctions;
 import org.openecomp.sdc.be.tosca.PropertyConvertor;
 import org.openecomp.sdc.common.log.wrappers.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -47,13 +48,15 @@
     private final PropertyValueMerger propertyValueMerger;
     private final ApplicationDataTypeCache dataTypeCache;
     
-    private final PropertyConvertor propertyConvertor = PropertyConvertor.getInstance();
+    private final PropertyConvertor propertyConvertor;
     private final Gson gson = new Gson();
 
-    
-    public PropertyDataValueMergeBusinessLogic(PropertyValueMerger propertyValueMerger, ApplicationDataTypeCache dataTypeCache) {
+    @Autowired
+    public PropertyDataValueMergeBusinessLogic(PropertyValueMerger propertyValueMerger,
+            ApplicationDataTypeCache dataTypeCache, PropertyConvertor propertyConvertor) {
         this.propertyValueMerger = propertyValueMerger;
         this.dataTypeCache = dataTypeCache;
+        this.propertyConvertor = propertyConvertor;
     }
 
     /**
@@ -94,7 +97,7 @@
         String propValue = propertyDataDefinition.getValue() == null ? "": propertyDataDefinition.getValue();
         String propertyType = propertyDataDefinition.getType();
         String innerType = propertyDataDefinition.getSchemaType();
-        return propertyConvertor.convertToToscaObject(propertyType, propValue, innerType, dataTypes, true);
+        return propertyConvertor.convertToToscaObject(propertyDataDefinition, propValue, dataTypes, true);
     }
 
     protected void mergePropertyGetInputsValues(PropertyDataDefinition oldProp, PropertyDataDefinition newProp) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
index 4c891f8..9c82a29 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
@@ -28,7 +28,7 @@
 import org.openecomp.sdc.be.model.InterfaceDefinition;
 import org.openecomp.sdc.be.model.Operation;
 import org.openecomp.sdc.be.model.tosca.ToscaFunctions;
-import org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil;
+import org.openecomp.sdc.be.tosca.InterfacesOperationsConverter;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -116,7 +116,7 @@
     public static Map<String, List<String>> createMappedInputPropertyDefaultValue(String propertyName) {
         Map<String, List<String>> getPropertyMap = new HashMap<>();
         List<String> values = new ArrayList<>();
-        values.add(InterfacesOperationsToscaUtil.SELF);
+        values.add(InterfacesOperationsConverter.SELF);
         if (Objects.nonNull(propertyName) && !propertyName.isEmpty()) {
             values.addAll(Arrays.asList(propertyName.split("\\.")));
         }
@@ -128,7 +128,7 @@
                                                                                        String propertyName) {
         Map<String, List<String>> getPropertyMap = new HashMap<>();
         List<String> values = new ArrayList<>();
-        values.add(InterfacesOperationsToscaUtil.SELF);
+        values.add(InterfacesOperationsConverter.SELF);
         values.add(capabilityName);
 
         if (Objects.nonNull(propertyName) && !propertyName.isEmpty()) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java
index d438784..a8d1eb6 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java
@@ -75,7 +75,7 @@
 import java.util.Map.Entry;
 import java.util.stream.Collectors;
 
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.SELF;
+import static org.openecomp.sdc.be.tosca.InterfacesOperationsConverter.SELF;
 
 @Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
 @Path("/v1/catalog")
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverter.java
index 8138030..9a55fb8 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverter.java
@@ -20,9 +20,22 @@
 
 package org.openecomp.sdc.be.tosca;
 
+import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isNoneBlank;
+
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
 import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -55,20 +68,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
-import static org.apache.commons.lang3.StringUtils.isBlank;
-import static org.apache.commons.lang3.StringUtils.isNoneBlank;
-
 /**
  * Allows to convert requirements\capabilities of a component to requirements\capabilities of a substitution mappings section of a tosca template
  *
@@ -86,6 +85,8 @@
 
     @Autowired
     private ToscaOperationFacade toscaOperationFacade;
+    @Autowired
+    private PropertyConvertor propertyConvertor;
 
     public CapabilityRequirementConverter() {}
 
@@ -182,7 +183,7 @@
             innerType = prop.getSchema().getProperty().getType();
         }
         String propValue = prop.getValue() == null ? prop.getDefaultValue() : prop.getValue();
-        return PropertyConvertor.getInstance().convertToToscaObject(propertyType, propValue, innerType, dataTypes, false);
+        return propertyConvertor.convertToToscaObject(prop, propValue, dataTypes, false);
     }
     /**
      * Allows to convert requirements of a node type to tosca template requirements representation
@@ -573,7 +574,7 @@
         if (isNotEmpty(properties)) {
             Map<String, ToscaProperty> toscaProperties = new HashMap<>();
             for (PropertyDefinition property : properties) {
-                ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(dataTypes, property, PropertyConvertor.PropertyType.CAPABILITY);
+                ToscaProperty toscaProperty = propertyConvertor.convertProperty(dataTypes, property, PropertyConvertor.PropertyType.CAPABILITY);
                 toscaProperties.put(property.getName(), toscaProperty);
             }
             toscaCapability.setProperties(toscaProperties);
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/GroupExportParserImpl.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/GroupExportParserImpl.java
index 0b6d5d8..981c444 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/GroupExportParserImpl.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/GroupExportParserImpl.java
@@ -69,11 +69,12 @@
 
     private Map<String, DataTypeDefinition> dataTypes;
     private ApplicationDataTypeCache dataTypeCache;
-    private PropertyConvertor propertyConvertor = PropertyConvertor.getInstance();
+    private final PropertyConvertor propertyConvertor;
     
     @Autowired
-	public GroupExportParserImpl(ApplicationDataTypeCache dataTypeCache) {
+	public GroupExportParserImpl(ApplicationDataTypeCache dataTypeCache, PropertyConvertor propertyConvertor) {
 		this.dataTypeCache = dataTypeCache;
+		this.propertyConvertor = propertyConvertor;
 		this.dataTypes = getDataTypes();
 	}
     
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
similarity index 91%
rename from catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java
rename to catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
index 4c0fb25..0e5c55e 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2016-2018 European Support Limited
+ * Copyright © 2016-2020 European Support Limited
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.openecomp.sdc.be.tosca.utils;
+package org.openecomp.sdc.be.tosca;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -28,20 +28,23 @@
 import org.openecomp.sdc.be.model.InterfaceDefinition;
 import org.openecomp.sdc.be.model.Product;
 import org.openecomp.sdc.be.model.tosca.ToscaFunctions;
-import org.openecomp.sdc.be.tosca.PropertyConvertor;
 import org.openecomp.sdc.be.tosca.model.ToscaInterfaceDefinition;
 import org.openecomp.sdc.be.tosca.model.ToscaInterfaceNodeType;
 import org.openecomp.sdc.be.tosca.model.ToscaLifecycleOperationDefinition;
 import org.openecomp.sdc.be.tosca.model.ToscaNodeType;
 import org.openecomp.sdc.be.tosca.model.ToscaProperty;
+import org.openecomp.sdc.be.tosca.utils.OperationArtifactUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+@Service
+public class InterfacesOperationsConverter {
 
-public class InterfacesOperationsToscaUtil {
 
     private static final String DERIVED_FROM_STANDARD_INTERFACE = "tosca.interfaces.node.lifecycle.Standard";
     private static final String DERIVED_FROM_BASE_DEFAULT = "org.openecomp.interfaces.node.lifecycle.";
@@ -55,7 +58,11 @@
     public static final String SELF = "SELF";
     private static final String LOCAL_INTERFACE_TYPE = "Local";
 
-    private InterfacesOperationsToscaUtil() {
+    private PropertyConvertor propertyConvertor;
+
+    @Autowired
+    public InterfacesOperationsConverter(PropertyConvertor propertyConvertor) {
+        this.propertyConvertor = propertyConvertor;
     }
 
     /**
@@ -104,7 +111,7 @@
      * @param component to work on
      * @param nodeType  to which the interfaces element will be added
      */
-    public static void addInterfaceDefinitionElement(Component component, ToscaNodeType nodeType,
+    public void addInterfaceDefinitionElement(Component component, ToscaNodeType nodeType,
                                                      Map<String, DataTypeDefinition> dataTypes,
                                                      boolean isAssociatedComponent) {
         if (component instanceof Product) {
@@ -121,13 +128,13 @@
         }
     }
 
-    private static Map<String, Object> getInterfacesMap(Component component,
+    private Map<String, Object> getInterfacesMap(Component component,
                                                         Map<String, DataTypeDefinition> dataTypes,
                                                         boolean isAssociatedComponent) {
         return getInterfacesMap(component, null, component.getInterfaces(), dataTypes, isAssociatedComponent, false);
     }
 
-    public static Map<String, Object> getInterfacesMap(Component component,
+    public Map<String, Object> getInterfacesMap(Component component,
                                                        ComponentInstance componentInstance,
                                                        Map<String, InterfaceDefinition> interfaces,
                                                        Map<String, DataTypeDefinition> dataTypes,
@@ -242,7 +249,7 @@
         return false;
     }
 
-    private static void fillToscaOperationInputs(OperationDataDefinition operation,
+    private void fillToscaOperationInputs(OperationDataDefinition operation,
                                                  Map<String, DataTypeDefinition> dataTypes,
                                                  ToscaLifecycleOperationDefinition toscaOperation,
                                                  boolean isServiceProxyInterface) {
@@ -260,11 +267,11 @@
             if (isServiceProxyInterface) {
                 String inputValue = Objects.nonNull(input.getValue()) ? getInputValue(input.getValue()) :
                         getInputValue(input.getToscaDefaultValue());
-                toscaInput.setDefaultp(new PropertyConvertor().convertToToscaObject(input.getType(),
-                        inputValue, input.getSchemaType(), dataTypes, false));
+                toscaInput.setDefaultp(propertyConvertor.convertToToscaObject(input, inputValue, dataTypes, false));
             } else {
-                toscaInput.setDefaultp(new PropertyConvertor().convertToToscaObject(input.getType(),
-                        getInputValue(input.getToscaDefaultValue()), input.getSchemaType(), dataTypes, false));
+                toscaInput.setDefaultp(propertyConvertor
+                                               .convertToToscaObject(input, getInputValue(input.getToscaDefaultValue()),
+                                                       dataTypes, false));
             }
             toscaInputs.put(input.getName(), toscaInput);
         }
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PolicyExportParserImpl.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PolicyExportParserImpl.java
index 776676f..ca4d405 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PolicyExportParserImpl.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PolicyExportParserImpl.java
@@ -58,11 +58,12 @@
    
 	private ApplicationDataTypeCache dataTypeCache;
 	private Map<String, DataTypeDefinition> dataTypes;
-	private PropertyConvertor propertyConvertor = PropertyConvertor.getInstance();
+	private PropertyConvertor propertyConvertor;
 	
 	@Autowired
-	public PolicyExportParserImpl(ApplicationDataTypeCache dataTypeCache) {
+	public PolicyExportParserImpl(ApplicationDataTypeCache dataTypeCache, PropertyConvertor propertyConvertor) {
 		this.dataTypeCache = dataTypeCache;
+		this.propertyConvertor = propertyConvertor;
 		this.dataTypes = getDataTypes();
 	}
 	
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java
index 4e4afb0..81c91cc 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java
@@ -20,12 +20,17 @@
 
 package org.openecomp.sdc.be.tosca;
 
-import com.google.gson.Gson;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import com.google.gson.stream.JsonReader;
 import fj.data.Either;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Supplier;
 import org.apache.commons.lang3.StringUtils;
 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
@@ -43,16 +48,10 @@
 import org.openecomp.sdc.be.tosca.model.ToscaNodeType;
 import org.openecomp.sdc.be.tosca.model.ToscaProperty;
 import org.openecomp.sdc.common.log.wrappers.Logger;
+import org.springframework.stereotype.Service;
 
-import java.io.StringReader;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.function.Supplier;
-
+@Service
 public class PropertyConvertor {
-    private static PropertyConvertor instance;
     private JsonParser jsonParser = new JsonParser();
     private static final Logger log = Logger.getLogger(PropertyConvertor.class);
     public  enum PropertyType  {
@@ -60,17 +59,7 @@
         INPUT,
         PROPERTY
     }
-    Gson gson = new Gson();
-    public PropertyConvertor() {
 
-    }
-
-    public static synchronized PropertyConvertor getInstance() {
-        if (instance == null) {
-            instance = new PropertyConvertor();
-        }
-        return instance;
-    }
 
     public Either<ToscaNodeType, ToscaError> convertProperties(Component component, ToscaNodeType toscaNodeType, Map<String, DataTypeDefinition> dataTypes) {
 
@@ -94,32 +83,19 @@
 
     public ToscaProperty convertProperty(Map<String, DataTypeDefinition> dataTypes, PropertyDefinition property, PropertyType propertyType) {
         ToscaProperty prop = new ToscaProperty();
-
-        String innerType = null;
+        log.trace("try to convert property {} from type {} with default value [{}]", property.getName(), property.getType(), property.getDefaultValue());
         SchemaDefinition schema = property.getSchema();
         if (schema != null && schema.getProperty() != null && schema.getProperty().getType() != null && !schema.getProperty().getType().isEmpty()) {
-            innerType = schema.getProperty().getType();
             EntrySchema eschema = new EntrySchema();
-            eschema.setType(innerType);
+            eschema.setType(schema.getProperty().getType());
             eschema.setDescription(schema.getProperty().getDescription());
             prop.setEntry_schema(eschema);
         }
-        return getToscaProperty(dataTypes, property, prop, innerType, propertyType);
-
-    }
-
-    private ToscaProperty getToscaProperty(Map<String, DataTypeDefinition> dataTypes,
-                                           PropertyDataDefinition property,
-                                           ToscaProperty prop,
-                                           String innerType,
-                                           PropertyType propertyType) {
-        log.trace("try to convert property {} from type {} with default value [{}]", property.getName(), property.getType(), property.getDefaultValue());
         String defaultValue = property.getDefaultValue();
         if(Objects.isNull(defaultValue)) {
             defaultValue = property.getValue();
         }
-        Object convertedObj =
-            convertToToscaObject(property.getType(), defaultValue, innerType, dataTypes, false);
+        Object convertedObj = convertToToscaObject(property, defaultValue, dataTypes, false);
         if (convertedObj != null) {
             prop.setDefaultp(convertedObj);
         }
@@ -133,7 +109,9 @@
     }
     
 
-    public Object convertToToscaObject(String propertyType, String value, String innerType, Map<String, DataTypeDefinition> dataTypes, boolean preserveEmptyValue) {
+    public Object convertToToscaObject(PropertyDataDefinition property, String value, Map<String, DataTypeDefinition> dataTypes, boolean preserveEmptyValue) {
+        String propertyType = property.getType();
+        String innerType = property.getSchemaType();
         log.trace("try to convert propertyType {} , value [{}], innerType {}", propertyType, value, innerType);
         if (StringUtils.isEmpty(value)) {
             value = DataTypePropertyConverter.getInstance().getDataTypePropertiesDefaultValuesRec(propertyType, dataTypes);
@@ -144,7 +122,7 @@
         try {
             ToscaMapValueConverter mapConverterInst = ToscaMapValueConverter.getInstance();
             ToscaValueConverter innerConverter = null;
-            Boolean isScalar = true;
+            boolean isScalar = true;
 
             ToscaPropertyType type = ToscaPropertyType.isValidType(propertyType);
             if (type == null) {
@@ -234,12 +212,6 @@
 
     private <T extends PropertyDataDefinition> Object convertValue(Map<String, DataTypeDefinition> dataTypes,
              T input, Supplier<String> supplier) {
-        String propertyType = input.getType();
-        String innerType = null;
-        if (input.getSchema() != null && input.getSchema().getProperty() != null) {
-            innerType = input.getSchema().getProperty().getType();
-        }
-        return convertToToscaObject(propertyType, supplier.get(), innerType, dataTypes, false);
+        return convertToToscaObject(input, supplier.get(), dataTypes, false);
     }
-
 }
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
index 995d511..9768421 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
@@ -20,9 +20,28 @@
 
 package org.openecomp.sdc.be.tosca;
 
+import static org.apache.commons.collections.CollectionUtils.isEmpty;
+import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
+import static org.apache.commons.collections.MapUtils.isNotEmpty;
+import static org.openecomp.sdc.be.components.utils.PropertiesUtils.resolvePropertyValueFromInput;
+import static org.openecomp.sdc.be.tosca.InterfacesOperationsConverter.addInterfaceTypeElement;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import fj.data.Either;
+import java.beans.IntrospectionException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang.StringUtils;
@@ -87,7 +106,6 @@
 import org.openecomp.sdc.be.tosca.model.ToscaTopolgyTemplate;
 import org.openecomp.sdc.be.tosca.utils.ForwardingPathToscaUtil;
 import org.openecomp.sdc.be.tosca.utils.InputConverter;
-import org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil;
 import org.openecomp.sdc.common.log.wrappers.Logger;
 import org.openecomp.sdc.externalupload.utils.ServiceUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -104,30 +122,6 @@
 import org.yaml.snakeyaml.representer.Represent;
 import org.yaml.snakeyaml.representer.Representer;
 
-import java.beans.IntrospectionException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-
-import static org.apache.commons.collections.CollectionUtils.isEmpty;
-import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
-import static org.apache.commons.collections.MapUtils.isNotEmpty;
-import static org.openecomp.sdc.be.components.utils.PropertiesUtils.resolvePropertyValueFromInput;
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.addInterfaceDefinitionElement;
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.addInterfaceTypeElement;
-import static org.openecomp.sdc.be.tosca.utils.ToscaExportUtils.addInputsToProperties;
-import static org.openecomp.sdc.be.tosca.utils.ToscaExportUtils.getProxyNodeTypeInterfaces;
-import static org.openecomp.sdc.be.tosca.utils.ToscaExportUtils.getProxyNodeTypeProperties;
-
 @org.springframework.stereotype.Component("tosca-export-handler")
 public class ToscaExportHandler {
 
@@ -139,19 +133,23 @@
     private PropertyConvertor propertyConvertor;
     private InputConverter inputConverter;
     private InterfaceLifecycleOperation interfaceLifecycleOperation;
+    private InterfacesOperationsConverter interfacesOperationsConverter;
 
     @Autowired
     public ToscaExportHandler(ApplicationDataTypeCache dataTypeCache, ToscaOperationFacade toscaOperationFacade,
-                              CapabilityRequirementConverter capabilityRequirementConverter, PolicyExportParser policyExportParser,
-                              GroupExportParser groupExportParser, InputConverter inputConverter, InterfaceLifecycleOperation interfaceLifecycleOperation) {
+            CapabilityRequirementConverter capabilityRequirementConverter, PolicyExportParser policyExportParser,
+            GroupExportParser groupExportParser, PropertyConvertor propertyConvertor, InputConverter inputConverter,
+            InterfaceLifecycleOperation interfaceLifecycleOperation,
+            InterfacesOperationsConverter interfacesOperationsConverter) {
             this.dataTypeCache = dataTypeCache;
             this.toscaOperationFacade = toscaOperationFacade;
             this.capabilityRequirementConverter = capabilityRequirementConverter;
             this.policyExportParser = policyExportParser;
             this.groupExportParser = groupExportParser;
-            this.propertyConvertor = PropertyConvertor.getInstance();
+            this.propertyConvertor = propertyConvertor;
             this.inputConverter =  inputConverter;
             this.interfaceLifecycleOperation = interfaceLifecycleOperation;
+            this.interfacesOperationsConverter = interfacesOperationsConverter;
       }
 
 
@@ -603,7 +601,7 @@
 
         List<InputDefinition> inputDef = component.getInputs();
         Map<String, ToscaProperty> mergedProperties = new HashMap<>();
-        addInterfaceDefinitionElement(component, toscaNodeType, dataTypes, isAssociatedComponent);
+        interfacesOperationsConverter.addInterfaceDefinitionElement(component, toscaNodeType, dataTypes, isAssociatedComponent);
         addInputsToProperties(dataTypes, inputDef, mergedProperties);
 
         if(CollectionUtils.isNotEmpty(component.getProperties())) {
@@ -834,7 +832,7 @@
                 currServiceInterfaces.forEach(instInterface -> tmpInterfaces.put(instInterface
                     .getUniqueId(), instInterface));
 
-                interfaces = InterfacesOperationsToscaUtil
+                interfaces = interfacesOperationsConverter
                                      .getInterfacesMap(parentComponent, componentInstance, tmpInterfaces, dataTypes, true, true);
             }
         } else {
@@ -942,8 +940,7 @@
         if (input.getSchema() != null && input.getSchema().getProperty() != null) {
             innerType = input.getSchema().getProperty().getType();
         }
-        return propertyConvertor.convertToToscaObject(propertyType, supplier.get(), innerType,
-            dataTypes, true);
+        return propertyConvertor.convertToToscaObject(input, supplier.get(), dataTypes, true);
     }
 
     private ToscaNodeType createNodeType(Component component) {
@@ -1425,7 +1422,7 @@
     }
 
     private static class CustomRepresenter extends Representer {
-        public CustomRepresenter() {
+        CustomRepresenter() {
             super();
             // null representer is exceptional and it is stored as an instance
             // variable.
@@ -1438,16 +1435,15 @@
                 Tag customTag) {
             if (propertyValue == null) {
                 return null;
-            } else {
-                // skip not relevant for Tosca property
-                if ("dependencies".equals(property.getName())) {
-                    return null;
-                }
-                NodeTuple defaultNode = super.representJavaBeanProperty(javaBean, property, propertyValue, customTag);
-
-                return "_defaultp_".equals(property.getName())
-                        ? new NodeTuple(representData("default"), defaultNode.getValueNode()) : defaultNode;
             }
+            // skip not relevant for Tosca property
+            if ("dependencies".equals(property.getName())) {
+                return null;
+            }
+            NodeTuple defaultNode = super.representJavaBeanProperty(javaBean, property, propertyValue, customTag);
+
+            return "_defaultp_".equals(property.getName())
+                    ? new NodeTuple(representData("default"), defaultNode.getValueNode()) : defaultNode;
         }
 
         @Override
@@ -1495,5 +1491,61 @@
             return interfaceObject;
 
     }
+
+    Optional<Map<String, ToscaProperty>> getProxyNodeTypeProperties(Component proxyComponent,
+            Map<String, DataTypeDefinition>
+                    dataTypes) {
+        if (Objects.isNull(proxyComponent)) {
+            return Optional.empty();
+        }
+        Map<String, ToscaProperty> proxyProperties = new HashMap<>();
+        addInputsToProperties(dataTypes, proxyComponent.getInputs(), proxyProperties);
+        if (CollectionUtils.isNotEmpty(proxyComponent.getProperties())) {
+            proxyProperties.putAll(proxyComponent.getProperties().stream()
+                                           .map(propertyDefinition -> resolvePropertyValueFromInput(propertyDefinition,
+                                                   proxyComponent.getInputs()))
+                                           .collect(Collectors.toMap(PropertyDataDefinition::getName,
+                                                   property -> propertyConvertor.convertProperty(dataTypes, property,
+                                                           PropertyConvertor.PropertyType.PROPERTY))));
+        }
+        return MapUtils.isNotEmpty(proxyProperties) ? Optional.of(proxyProperties) : Optional.empty();
+    }
+
+    void addInputsToProperties(Map<String, DataTypeDefinition> dataTypes,
+            List<InputDefinition> componentInputs,
+            Map<String, ToscaProperty> mergedProperties) {
+        if (CollectionUtils.isEmpty(componentInputs)) {
+            return;
+        }
+        for(InputDefinition input : componentInputs) {
+            ToscaProperty property = propertyConvertor.convertProperty(dataTypes, input,
+                    PropertyConvertor.PropertyType.INPUT);
+            mergedProperties.put(input.getName(), property);
+        }
+    }
+
+    Optional<Map<String, Object>> getProxyNodeTypeInterfaces(Component proxyComponent,
+            Map<String, DataTypeDefinition> dataTypes) {
+        if (Objects.isNull(proxyComponent) || MapUtils.isEmpty(proxyComponent.getInterfaces())) {
+            return Optional.empty();
+        }
+        Map<String, InterfaceDefinition> proxyComponentInterfaces = proxyComponent.getInterfaces();
+        //Unset artifact path for operation implementation for proxy node types as for operations with artifacts it is
+        // always available in the proxy node template
+        removeOperationImplementationForProxyNodeType(proxyComponentInterfaces);
+        return Optional.ofNullable(interfacesOperationsConverter
+                                           .getInterfacesMap(proxyComponent, null, proxyComponentInterfaces, dataTypes,
+                                                   false, false));
+    }
+
+    private static void removeOperationImplementationForProxyNodeType(
+            Map<String, InterfaceDefinition> proxyComponentInterfaces) {
+        if (MapUtils.isEmpty(proxyComponentInterfaces)) {
+            return;
+        }
+        proxyComponentInterfaces.values().stream().map(InterfaceDataDefinition::getOperations)
+                .filter(MapUtils::isNotEmpty)
+                .forEach(operations -> operations.values().forEach(operation -> operation.setImplementation(null)));
+    }
 }
 
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InputConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InputConverter.java
index 4630540..475627b 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InputConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InputConverter.java
@@ -33,17 +33,18 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import org.springframework.beans.factory.annotation.Autowired;
 
 @org.springframework.stereotype.Component
 public class InputConverter {
     private PropertyConvertor propertyConvertor;
     private static final Logger log = Logger.getLogger(ToscaExportHandler.class);
 
-
-    public InputConverter() {
-        this.propertyConvertor = PropertyConvertor.getInstance();
-
+    @Autowired
+    public InputConverter(PropertyConvertor propertyConvertor) {
+        this.propertyConvertor = propertyConvertor;
     }
+
     /**
      * This is the converter made for input
      * input is derived from properties and  is similar to properties
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ToscaExportUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ToscaExportUtils.java
deleted file mode 100644
index beb9dab..0000000
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/ToscaExportUtils.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright © 2016-2019 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.be.tosca.utils;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.MapUtils;
-import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.DataTypeDefinition;
-import org.openecomp.sdc.be.model.InputDefinition;
-import org.openecomp.sdc.be.model.InterfaceDefinition;
-import org.openecomp.sdc.be.tosca.PropertyConvertor;
-import org.openecomp.sdc.be.tosca.model.ToscaProperty;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import static org.openecomp.sdc.be.components.utils.PropertiesUtils.resolvePropertyValueFromInput;
-
-public class ToscaExportUtils {
-
-    private ToscaExportUtils() {
-        //Hiding implicit default constructor
-    }
-
-    public static Optional<Map<String, Object>> getProxyNodeTypeInterfaces(Component proxyComponent,
-                                                                           Map<String, DataTypeDefinition> dataTypes) {
-        if (Objects.isNull(proxyComponent) || MapUtils.isEmpty(proxyComponent.getInterfaces())) {
-            return Optional.empty();
-        }
-        Map<String, InterfaceDefinition> proxyComponentInterfaces = proxyComponent.getInterfaces();
-        //Unset artifact path for operation implementation for proxy node types as for operations with artifacts it is
-        // always available in the proxy node template
-        removeOperationImplementationForProxyNodeType(proxyComponentInterfaces);
-        return Optional.ofNullable(InterfacesOperationsToscaUtil
-                .getInterfacesMap(proxyComponent, null, proxyComponentInterfaces, dataTypes, false, false));
-    }
-
-    public static Optional<Map<String, ToscaProperty>> getProxyNodeTypeProperties(Component proxyComponent,
-                                                                                  Map<String, DataTypeDefinition>
-                                                                                          dataTypes) {
-        if (Objects.isNull(proxyComponent)) {
-            return Optional.empty();
-        }
-        Map<String, ToscaProperty> proxyProperties = new HashMap<>();
-        addInputsToProperties(dataTypes, proxyComponent.getInputs(), proxyProperties);
-        if (CollectionUtils.isNotEmpty(proxyComponent.getProperties())) {
-            proxyProperties.putAll(proxyComponent.getProperties().stream()
-                    .map(propertyDefinition -> resolvePropertyValueFromInput(propertyDefinition,
-                            proxyComponent.getInputs()))
-                    .collect(Collectors.toMap(PropertyDataDefinition::getName,
-                            property -> PropertyConvertor.getInstance().convertProperty(dataTypes, property,
-                                    PropertyConvertor.PropertyType.PROPERTY))));
-        }
-        return MapUtils.isNotEmpty(proxyProperties) ? Optional.of(proxyProperties) : Optional.empty();
-    }
-
-    public static void addInputsToProperties(Map<String, DataTypeDefinition> dataTypes,
-                                       List<InputDefinition> componentInputs,
-                                       Map<String, ToscaProperty> mergedProperties) {
-        if (CollectionUtils.isEmpty(componentInputs)) {
-            return;
-        }
-        for(InputDefinition input : componentInputs) {
-            ToscaProperty property = new PropertyConvertor().convertProperty(dataTypes, input,
-                    PropertyConvertor.PropertyType.INPUT);
-            mergedProperties.put(input.getName(), property);
-        }
-    }
-
-    private static void removeOperationImplementationForProxyNodeType(Map<String, InterfaceDefinition>
-                                                                          proxyComponentInterfaces) {
-        if (MapUtils.isEmpty(proxyComponentInterfaces)) {
-            return;
-        }
-        proxyComponentInterfaces.values().stream()
-                .map(InterfaceDataDefinition::getOperations)
-                .filter(MapUtils::isNotEmpty)
-                .forEach(operations -> operations.values()
-                        .forEach(operation -> operation.setImplementation(null)));
-    }
-}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/PropertiesUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/PropertiesUtilsTest.java
index d038381..8789b15 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/PropertiesUtilsTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/PropertiesUtilsTest.java
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 package org.openecomp.sdc.be.components.impl.utils;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java
index def3f8c..bded51d 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java
@@ -20,10 +20,24 @@
 
 package org.openecomp.sdc.be.components.merge.property;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.Maps;
 import fj.data.Either;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -37,21 +51,7 @@
 import org.openecomp.sdc.be.model.PropertyDefinition;
 import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache;
 import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
+import org.openecomp.sdc.be.tosca.PropertyConvertor;
 
 @RunWith(MockitoJUnitRunner.class)
 public class PropertyDataValueMergeBusinessLogicTest {
@@ -67,7 +67,8 @@
     public void setUp() throws Exception {
         PropertyValueMerger propertyValueMerger = new PropertyValueMerger();
         
-        testInstance = new PropertyDataValueMergeBusinessLogic(propertyValueMerger, applicationDataTypeCache);
+        testInstance = new PropertyDataValueMergeBusinessLogic(propertyValueMerger, applicationDataTypeCache,
+                new PropertyConvertor());
     }
 
     @Test
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverterTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverterTest.java
index 5d6c982..5254c08 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverterTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CapabilityRequirementConverterTest.java
@@ -19,6 +19,8 @@
 
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
@@ -35,6 +37,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
+import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade;
 
 import static java.util.Arrays.asList;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -42,6 +45,14 @@
 
 public class CapabilityRequirementConverterTest {
 
+	@InjectMocks
+	CapabilityRequirementConverter testSubject;
+
+	@Mock
+	ToscaOperationFacade toscaOperationFacade;
+	@Mock
+	private PropertyConvertor propertyConvertorMock;
+
     CapabilityRequirementConverter capabiltyRequirementConvertor =  Mockito.spy(new CapabilityRequirementConverter());
     ComponentInstance instanceProxy  =  Mockito.spy( new ComponentInstance() );
     ComponentInstance vfInstance  =  Mockito.spy( new ComponentInstance() );
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/GroupExportParserImplTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/GroupExportParserImplTest.java
index 35be382..b55f7d8 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/GroupExportParserImplTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/GroupExportParserImplTest.java
@@ -68,9 +68,10 @@
 
 	@Mock
 	private ApplicationDataTypeCache dataTypeCache;
-
 	@Mock
 	private Component component;
+	@Mock
+	private PropertyConvertor propertyConvertor;
 
 	@Before
 	public void setUp() throws Exception {
@@ -79,13 +80,14 @@
 
 	private void initGroupExportParser() {
 		when(dataTypeCache.getAll()).thenReturn(Either.left(null));
-		groupExportParser = new GroupExportParserImpl(dataTypeCache);
+		groupExportParser = new GroupExportParserImpl(dataTypeCache, propertyConvertor);
 	}
 
 	@Test
 	public void failToGetAllDataTypes() {
 		when(dataTypeCache.getAll()).thenReturn(Either.right(null));
-		assertThatExceptionOfType(SdcResourceNotFoundException.class).isThrownBy(() -> groupExportParser = new GroupExportParserImpl(dataTypeCache));
+		assertThatExceptionOfType(SdcResourceNotFoundException.class).isThrownBy(() -> groupExportParser = new GroupExportParserImpl(dataTypeCache,
+                propertyConvertor));
 	}
 
 	@Test
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/InputAnnotationConvertToToscaTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/InputAnnotationConvertToToscaTest.java
index a3d4ae9..2d95fc1 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/InputAnnotationConvertToToscaTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/InputAnnotationConvertToToscaTest.java
@@ -77,10 +77,10 @@
         property3.setType(ToscaPropertyType.BOOLEAN.getType());
         property3.setValue("True");
 
-        dataTypes = new HashMap();
+        dataTypes = new HashMap<>();
         DataTypeDefinition dataTypeDefinition = new DataTypeDefinition();
 
-        List<PropertyDefinition> properties = new ArrayList();
+        List<PropertyDefinition> properties = new ArrayList<>();
         properties.add(property1);
 
         dataTypeDefinition.setProperties(properties);
@@ -91,7 +91,7 @@
         annotation.setName("Annotation1");
         annotation.setDescription("description1");
 
-        List<PropertyDataDefinition> propertiesAnnotation = new ArrayList();
+        List<PropertyDataDefinition> propertiesAnnotation = new ArrayList<>();
         propertiesAnnotation.add(property2);
         propertiesAnnotation.add(property3);
         annotation.setProperties(propertiesAnnotation);
@@ -107,7 +107,7 @@
 
         ArrayList<InputDefinition> inputDefList = new ArrayList<> ();
         inputDefList.add(inputDefinition);
-        inputConverter = new InputConverter();
+        inputConverter = new InputConverter(new PropertyConvertor());
         Map<String, ToscaProperty> resultInputs ;
         resultInputs = inputConverter.convertInputs(inputDefList,dataTypes);
         //verify one Input only
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PolicyExportParserImplTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PolicyExportParserImplTest.java
index 4e37757..b499830 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PolicyExportParserImplTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PolicyExportParserImplTest.java
@@ -63,6 +63,8 @@
     
 	@Mock
 	private ApplicationDataTypeCache dataTypeCache;
+	@Mock
+	private PropertyConvertor propertyConvertor;
 	
 	@Mock
 	private Component component;
@@ -71,7 +73,8 @@
 	public void failToGetAllDataTypes() {
 		
 		when(dataTypeCache.getAll()).thenReturn(Either.right(null));
-		assertThatExceptionOfType(SdcResourceNotFoundException.class).isThrownBy(() -> policiyExportParser = new PolicyExportParserImpl(dataTypeCache));
+		assertThatExceptionOfType(SdcResourceNotFoundException.class).isThrownBy(() -> policiyExportParser = new PolicyExportParserImpl(dataTypeCache,
+                propertyConvertor));
 	}
 	
 	@Test
@@ -79,7 +82,7 @@
 		
 		when(dataTypeCache.getAll()).thenReturn(Either.left(null));
 		when(component.getPolicies()).thenReturn(null);
-		policiyExportParser = new PolicyExportParserImpl(dataTypeCache);
+		policiyExportParser = new PolicyExportParserImpl(dataTypeCache, propertyConvertor);
 		Map<String, ToscaPolicyTemplate> policies = policiyExportParser.getPolicies(component);
 		assertThat(policies).isEqualTo(null);
 	}
@@ -105,7 +108,7 @@
 		when(component.getPolicies()).thenReturn(policiesToAdd);
 		when(component.getComponentInstances()).thenReturn(getComponentInstances());
 		when(component.getGroups()).thenReturn(getGroups());
-		policiyExportParser = new PolicyExportParserImpl(dataTypeCache);
+		policiyExportParser = new PolicyExportParserImpl(dataTypeCache, propertyConvertor);
 		
 		Map<String, ToscaPolicyTemplate> policies = policiyExportParser.getPolicies(component);
 		
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
index 0e6e171..d7c53d5 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
@@ -20,9 +20,25 @@
 
 package org.openecomp.sdc.be.tosca;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import fj.data.Either;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
 import org.openecomp.sdc.be.model.DataTypeDefinition;
@@ -32,29 +48,20 @@
 import org.openecomp.sdc.be.tosca.model.ToscaNodeType;
 import org.openecomp.sdc.be.tosca.model.ToscaProperty;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
+@RunWith(MockitoJUnitRunner.class)
 public class PropertyConvertorTest {
     private PropertyDefinition property;
-    Map<String, DataTypeDefinition> dataTypes;
+    private Map<String, DataTypeDefinition> dataTypes;
+
+    @InjectMocks
+    private PropertyConvertor propertyConvertor;
 
     @Before
     public void setUp(){
         property = new PropertyDefinition();
         property.setName("myProperty");
         property.setType(ToscaPropertyType.INTEGER.getType());
-        dataTypes = new HashMap();
+        dataTypes = new HashMap<>();
         dataTypes.put(property.getName(), new DataTypeDefinition());
     }
 
@@ -65,12 +72,12 @@
     	
     	property.setSchema(schema);
     	
-    	PropertyConvertor.getInstance().convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
+    	propertyConvertor.convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
     }
 
     @Test
     public void convertPropertyWhenValueAndDefaultNull() {
-        ToscaProperty prop = PropertyConvertor.getInstance().convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
+        ToscaProperty prop = propertyConvertor.convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
         assertNotNull(prop);
         assertNull(prop.getDefaultp());
     }
@@ -79,7 +86,7 @@
     public void convertPropertyWhenValueNullAndDefaultNotEmpty() {
         final String def = "1";
         property.setDefaultValue(def);
-        ToscaProperty result = PropertyConvertor.getInstance().convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
+        ToscaProperty result = propertyConvertor.convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
         assertNotNull(result);
         assertEquals(Integer.valueOf(def), result.getDefaultp());
     }
@@ -92,16 +99,15 @@
         property1.setDefaultValue("2");
         dataTypes.put(property1.getName(), new DataTypeDefinition());
         Resource resource = new Resource();
-        List<PropertyDefinition> properties = new ArrayList();
+        List<PropertyDefinition> properties = new ArrayList<>();
         properties.add(property);
         properties.add(property1);
         resource.setProperties(properties);
-        Either<ToscaNodeType, ToscaError> result = PropertyConvertor.getInstance().convertProperties(resource, new ToscaNodeType(), dataTypes);
+        Either<ToscaNodeType, ToscaError> result = propertyConvertor.convertProperties(resource, new ToscaNodeType(), dataTypes);
         assertTrue(result.isLeft());
         assertEquals(2, result.left().value().getProperties().size());
         int cnt = 0;
-        for (Iterator<ToscaProperty> it = result.left().value().getProperties().values().iterator(); it.hasNext(); ) {
-            ToscaProperty prop = it.next();
+        for (ToscaProperty prop : result.left().value().getProperties().values()) {
             if (prop.getDefaultp() == null) {
                 cnt++;
             }
@@ -118,15 +124,14 @@
         property.setDefaultValue("1");
         dataTypes.put(property1.getName(), new DataTypeDefinition());
         Resource resource = new Resource();
-        List<PropertyDefinition> properties = new ArrayList();
+        List<PropertyDefinition> properties = new ArrayList<>();
         properties.add(property);
         properties.add(property1);
         resource.setProperties(properties);
-        Either<ToscaNodeType, ToscaError> result = PropertyConvertor.getInstance().convertProperties(resource, new ToscaNodeType(), dataTypes);
+        Either<ToscaNodeType, ToscaError> result = propertyConvertor.convertProperties(resource, new ToscaNodeType(), dataTypes);
         assertTrue(result.isLeft());
         assertEquals(2, result.left().value().getProperties().size());
-        for (Iterator<ToscaProperty> it = result.left().value().getProperties().values().iterator(); it.hasNext(); ) {
-            ToscaProperty prop = it.next();
+        for (ToscaProperty prop : result.left().value().getProperties().values()) {
             assertNotNull(prop.getDefaultp());
         }
     }
@@ -138,15 +143,14 @@
         property1.setType(ToscaPropertyType.INTEGER.getType());
         dataTypes.put(property1.getName(), new DataTypeDefinition());
         Resource resource = new Resource();
-        List<PropertyDefinition> properties = new ArrayList();
+        List<PropertyDefinition> properties = new ArrayList<>();
         properties.add(property);
         properties.add(property1);
         resource.setProperties(properties);
-        Either<ToscaNodeType, ToscaError> result = PropertyConvertor.getInstance().convertProperties(resource, new ToscaNodeType(), dataTypes);
+        Either<ToscaNodeType, ToscaError> result = propertyConvertor.convertProperties(resource, new ToscaNodeType(), dataTypes);
         assertTrue(result.isLeft());
         assertEquals(2, result.left().value().getProperties().size());
-        for (Iterator<ToscaProperty> it = result.left().value().getProperties().values().iterator(); it.hasNext(); ) {
-            ToscaProperty prop = it.next();
+        for (ToscaProperty prop : result.left().value().getProperties().values()) {
             assertNull(prop.getDefaultp());
         }
      }
@@ -157,7 +161,7 @@
                 .setDefaultValue("::")
                 .setType(ToscaPropertyType.STRING.getType())
                 .build();
-        ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, PropertyConvertor.PropertyType.PROPERTY);
+        ToscaProperty toscaProperty = propertyConvertor.convertProperty(Collections.emptyMap(), property1, PropertyConvertor.PropertyType.PROPERTY);
         assertThat(toscaProperty.getDefaultp()).isEqualTo("::");
     }
 
@@ -167,7 +171,7 @@
                 .setDefaultValue("/")
                 .setType(ToscaPropertyType.STRING.getType())
                 .build();
-        ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, PropertyConvertor.PropertyType.PROPERTY);
+        ToscaProperty toscaProperty = propertyConvertor.convertProperty(Collections.emptyMap(), property1, PropertyConvertor.PropertyType.PROPERTY);
         assertThat(toscaProperty.getDefaultp()).isEqualTo("/");
     }
 
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java
index ca4f569..45cdbbd 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java
@@ -23,10 +23,14 @@
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyList;
 import static org.mockito.ArgumentMatchers.anyMap;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.Mockito.doReturn;
+import static org.openecomp.sdc.be.tosca.PropertyConvertor.PropertyType.PROPERTY;
 
 import fj.data.Either;
 import java.util.ArrayList;
@@ -35,6 +39,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.stream.Collectors;
 import mockit.Deencapsulation;
 import org.apache.commons.collections.MapUtils;
@@ -50,9 +55,11 @@
 import org.openecomp.sdc.be.components.BeConfDependentTest;
 import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
 import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus;
+import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathElementDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition;
 import org.openecomp.sdc.be.datatypes.elements.ToscaArtifactDataDefinition;
@@ -103,6 +110,7 @@
     private static final String COMPONENT_INPUT_TYPE = "integer";
     private static final String RESOURCE_NAME = "resource";
     private static final String TOSCA_VERSION = "tosca_simple_yaml_1_1";
+    private static final Map<String, DataTypeDefinition> DATA_TYPES = new HashMap<>();
 
     @InjectMocks
     private ToscaExportHandler testSubject;
@@ -123,17 +131,26 @@
     private GroupExportParser groupExportParser;
 
     @Mock
+    private PropertyConvertor propertyConvertor;
+
+    @Mock
     private GroupExportParserImpl groupExportParserImpl;
 
     @Mock
     private InterfaceLifecycleOperation interfaceLifecycleOperation;
 
     @Mock
+    private InterfacesOperationsConverter interfacesOperationsConverter;
+
+    @Mock
     private PolicyExportParser policyExportParser;
 
     @Before
     public void setUpMock() throws Exception {
         MockitoAnnotations.initMocks(this);
+		doReturn(new ToscaProperty()).when(propertyConvertor).convertProperty(any(), any(), eq(PROPERTY));
+        doReturn(new HashMap<String, Object>()).when(interfacesOperationsConverter)
+                .getInterfacesMap(any(), isNull(), anyMap(), anyMap(), anyBoolean(), anyBoolean());
     }
 
     private Resource getNewResource() {
@@ -1427,4 +1444,151 @@
         Assert.assertTrue(result.get("test_art").getFile().equals("test_file"));
         Assert.assertTrue(result.get("test_art").getType().equals("test_type"));
     }
+
+    @Test
+    public void testGetProxyNodeTypeInterfacesNoInterfaces() {
+        Component service = new Service();
+        Optional<Map<String, Object>> proxyNodeTypeInterfaces =
+                testSubject.getProxyNodeTypeInterfaces(service, DATA_TYPES);
+        Assert.assertFalse(proxyNodeTypeInterfaces.isPresent());
+    }
+
+    @Test
+    public void testGetProxyNodeTypeInterfaces() {
+        Component service = getTestComponent();
+        Optional<Map<String, Object>> proxyNodeTypeInterfaces =
+                testSubject.getProxyNodeTypeInterfaces(service, DATA_TYPES);
+        Assert.assertTrue(proxyNodeTypeInterfaces.isPresent());
+        Map<String, Object> componentInterfaces = proxyNodeTypeInterfaces.get();
+        Assert.assertNotNull(componentInterfaces);
+    }
+
+
+    @Test
+    public void testGetProxyNodeTypePropertiesComponentNull() {
+        Optional<Map<String, ToscaProperty>> proxyNodeTypeProperties =
+                testSubject.getProxyNodeTypeProperties(null, DATA_TYPES);
+        Assert.assertFalse(proxyNodeTypeProperties.isPresent());
+    }
+
+    @Test
+    public void testGetProxyNodeTypePropertiesNoProperties() {
+        Component service = new Service();
+        Optional<Map<String, ToscaProperty>> proxyNodeTypeProperties =
+                testSubject.getProxyNodeTypeProperties(service, DATA_TYPES);
+        Assert.assertFalse(proxyNodeTypeProperties.isPresent());
+    }
+
+    @Test
+    public void testGetProxyNodeTypeProperties() {
+        Component service = getTestComponent();
+        service.setProperties(Arrays.asList(createMockProperty("componentPropStr", "Default String Prop"),
+                createMockProperty("componentPropInt", null)));
+        Optional<Map<String, ToscaProperty>> proxyNodeTypeProperties =
+                testSubject.getProxyNodeTypeProperties(service, DATA_TYPES);
+        Assert.assertTrue(proxyNodeTypeProperties.isPresent());
+        Map<String, ToscaProperty> componentProperties = proxyNodeTypeProperties.get();
+        Assert.assertNotNull(componentProperties);
+        Assert.assertEquals(2, componentProperties.size());
+    }
+
+    @Test
+    public void testAddInputsToPropertiesNoInputs() {
+        Component service = getTestComponent();
+        service.setProperties(Arrays.asList(createMockProperty("componentPropStr", "Default String Prop"),
+                createMockProperty("componentPropInt", null)));
+        Optional<Map<String, ToscaProperty>> proxyNodeTypePropertiesResult =
+                testSubject.getProxyNodeTypeProperties(service, DATA_TYPES);
+
+        Assert.assertTrue(proxyNodeTypePropertiesResult.isPresent());
+        Map<String, ToscaProperty> proxyNodeTypeProperties = proxyNodeTypePropertiesResult.get();
+        testSubject.addInputsToProperties(DATA_TYPES, null, proxyNodeTypeProperties);
+        Assert.assertNotNull(proxyNodeTypeProperties);
+        Assert.assertEquals(2, proxyNodeTypeProperties.size());
+        testSubject.addInputsToProperties(DATA_TYPES, new ArrayList<>(), proxyNodeTypeProperties);
+        Assert.assertEquals(2, proxyNodeTypeProperties.size());
+    }
+
+    @Test
+    public void testAddInputsToPropertiesWithInputs() {
+        Component service = getTestComponent();
+        service.setProperties(Arrays.asList(createMockProperty("componentPropStr", "Default String Prop"),
+                createMockProperty("componentPropInt", null)));
+        service.setInputs(Arrays.asList(createMockInput("componentInputStr1",
+                "Default String Input1"), createMockInput("componentInputStr2", "Default String Input2")));
+        Optional<Map<String, ToscaProperty>> proxyNodeTypePropertiesResult =
+                testSubject.getProxyNodeTypeProperties(service, DATA_TYPES);
+
+        Assert.assertTrue(proxyNodeTypePropertiesResult.isPresent());
+        Map<String, ToscaProperty> proxyNodeTypeProperties = proxyNodeTypePropertiesResult.get();
+        testSubject.addInputsToProperties(DATA_TYPES, service.getInputs(), proxyNodeTypeProperties);
+        Assert.assertNotNull(proxyNodeTypeProperties);
+        Assert.assertEquals(4, proxyNodeTypeProperties.size());
+    }
+
+    @Test
+    public void testAddInputsToPropertiesOnlyInputs() {
+        Component service = getTestComponent();
+        service.setInputs(Arrays.asList(createMockInput("componentInputStr1",
+                "Default String Input1"), createMockInput("componentInputStr2", "Default String Input2")));
+        Optional<Map<String, ToscaProperty>> proxyNodeTypePropertiesResult =
+                testSubject.getProxyNodeTypeProperties(service, DATA_TYPES);
+
+        Assert.assertTrue(proxyNodeTypePropertiesResult.isPresent());
+        Map<String, ToscaProperty> proxyNodeTypeProperties = proxyNodeTypePropertiesResult.get();
+        testSubject.addInputsToProperties(DATA_TYPES, service.getInputs(), proxyNodeTypeProperties);
+        Assert.assertNotNull(proxyNodeTypeProperties);
+        Assert.assertEquals(2, proxyNodeTypeProperties.size());
+    }
+
+    @Test
+    public void testOperationImplementationInProxyNodeTypeNotPresent() {
+        Component service = getTestComponent();
+        InterfaceDefinition interfaceDefinition =
+                service.getInterfaces().get("normalizedServiceComponentName-interface");
+        interfaceDefinition.setOperations(new HashMap<>());
+        final OperationDataDefinition operation = new OperationDataDefinition();
+        operation.setName("start");
+        operation.setDescription("op description");
+        final ArtifactDataDefinition implementation = new ArtifactDataDefinition();
+        implementation.setArtifactName("createBPMN.bpmn");
+        operation.setImplementation(implementation);
+        interfaceDefinition.getOperations().put(operation.getName(), operation);
+        service.getInterfaces().put("normalizedServiceComponentName-interface", interfaceDefinition);
+        service.setInputs(Arrays.asList(createMockInput("componentInputStr1",
+                "Default String Input1"), createMockInput("componentInputStr2", "Default String Input2")));
+        Optional<Map<String, Object>> proxyNodeTypeInterfaces =
+                testSubject.getProxyNodeTypeInterfaces(service, DATA_TYPES);
+        Assert.assertTrue(proxyNodeTypeInterfaces.isPresent());
+        Map<String, Object> componentInterfaces = proxyNodeTypeInterfaces.get();
+        Assert.assertNotNull(componentInterfaces);
+    }
+
+    private Component getTestComponent() {
+        Component component = new Service();
+        component.setNormalizedName("normalizedServiceComponentName");
+        InterfaceDefinition addedInterface = new InterfaceDefinition();
+        addedInterface.setType("com.some.service.or.other.serviceName");
+        final String interfaceType = "normalizedServiceComponentName-interface";
+        component.setInterfaces(new HashMap<>());
+        component.getInterfaces().put(interfaceType, addedInterface);
+        return component;
+    }
+
+    private PropertyDefinition createMockProperty(String propertyName, String defaultValue){
+        PropertyDefinition propertyDefinition = new PropertyDefinition();
+        propertyDefinition.setName(propertyName);
+        propertyDefinition.setType("string");
+        propertyDefinition.setDefaultValue(defaultValue);
+        return propertyDefinition;
+    }
+
+    private InputDefinition createMockInput(String inputName, String defaultValue){
+        InputDefinition inputDefinition = new InputDefinition();
+        inputDefinition.setName(inputName);
+        inputDefinition.setType("string");
+        inputDefinition.setDefaultValue(defaultValue);
+        return inputDefinition;
+    }
+
 }
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java
deleted file mode 100644
index 55a2083..0000000
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright © 2016-2019 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.be.tosca;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.DataTypeDefinition;
-import org.openecomp.sdc.be.model.InputDefinition;
-import org.openecomp.sdc.be.model.InterfaceDefinition;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.tosca.model.ToscaProperty;
-import org.openecomp.sdc.be.tosca.utils.ToscaExportUtils;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-
-public class ToscaExportUtilsTest {
-
-    private static final Map<String, DataTypeDefinition> dataTypes = new HashMap<>();
-
-    @Test
-    public void testGetProxyNodeTypeInterfacesNoInterfaces() {
-        Component service = new Service();
-        Optional<Map<String, Object>> proxyNodeTypeInterfaces =
-                ToscaExportUtils.getProxyNodeTypeInterfaces(service, dataTypes);
-        Assert.assertFalse(proxyNodeTypeInterfaces.isPresent());
-    }
-
-    @Test
-    public void testGetProxyNodeTypeInterfaces() {
-        Component service = getTestComponent();
-        Optional<Map<String, Object>> proxyNodeTypeInterfaces =
-                ToscaExportUtils.getProxyNodeTypeInterfaces(service, dataTypes);
-        Assert.assertTrue(proxyNodeTypeInterfaces.isPresent());
-        Map<String, Object> componentInterfaces = proxyNodeTypeInterfaces.get();
-        Assert.assertNotNull(componentInterfaces);
-        Assert.assertEquals(1, componentInterfaces.size());
-    }
-
-
-    @Test
-    public void testGetProxyNodeTypePropertiesComponentNull() {
-        Optional<Map<String, ToscaProperty>> proxyNodeTypeProperties =
-                ToscaExportUtils.getProxyNodeTypeProperties(null, dataTypes);
-        Assert.assertFalse(proxyNodeTypeProperties.isPresent());
-    }
-
-    @Test
-    public void testGetProxyNodeTypePropertiesNoProperties() {
-        Component service = new Service();
-        Optional<Map<String, ToscaProperty>> proxyNodeTypeProperties =
-                ToscaExportUtils.getProxyNodeTypeProperties(service, dataTypes);
-        Assert.assertFalse(proxyNodeTypeProperties.isPresent());
-    }
-
-    @Test
-    public void testGetProxyNodeTypeProperties() {
-        Component service = getTestComponent();
-        service.setProperties(Arrays.asList(createMockProperty("componentPropStr", "Default String Prop"),
-                createMockProperty("componentPropInt", null)));
-        Optional<Map<String, ToscaProperty>> proxyNodeTypeProperties =
-                ToscaExportUtils.getProxyNodeTypeProperties(service, dataTypes);
-        Assert.assertTrue(proxyNodeTypeProperties.isPresent());
-        Map<String, ToscaProperty> componentProperties = proxyNodeTypeProperties.get();
-        Assert.assertNotNull(componentProperties);
-        Assert.assertEquals(2, componentProperties.size());
-    }
-
-    @Test
-    public void testAddInputsToPropertiesNoInputs() {
-        Component service = getTestComponent();
-        service.setProperties(Arrays.asList(createMockProperty("componentPropStr", "Default String Prop"),
-                createMockProperty("componentPropInt", null)));
-        Optional<Map<String, ToscaProperty>> proxyNodeTypePropertiesResult =
-                ToscaExportUtils.getProxyNodeTypeProperties(service, dataTypes);
-
-        Assert.assertTrue(proxyNodeTypePropertiesResult.isPresent());
-        Map<String, ToscaProperty> proxyNodeTypeProperties = proxyNodeTypePropertiesResult.get();
-        ToscaExportUtils.addInputsToProperties(dataTypes, null, proxyNodeTypeProperties);
-        Assert.assertNotNull(proxyNodeTypeProperties);
-        Assert.assertEquals(2, proxyNodeTypeProperties.size());
-        ToscaExportUtils.addInputsToProperties(dataTypes, new ArrayList<>(), proxyNodeTypeProperties);
-        Assert.assertEquals(2, proxyNodeTypeProperties.size());
-    }
-
-    @Test
-    public void testAddInputsToPropertiesWithInputs() {
-        Component service = getTestComponent();
-        service.setProperties(Arrays.asList(createMockProperty("componentPropStr", "Default String Prop"),
-                createMockProperty("componentPropInt", null)));
-        service.setInputs(Arrays.asList(createMockInput("componentInputStr1",
-                "Default String Input1"), createMockInput("componentInputStr2", "Default String Input2")));
-        Optional<Map<String, ToscaProperty>> proxyNodeTypePropertiesResult =
-                ToscaExportUtils.getProxyNodeTypeProperties(service, dataTypes);
-
-        Assert.assertTrue(proxyNodeTypePropertiesResult.isPresent());
-        Map<String, ToscaProperty> proxyNodeTypeProperties = proxyNodeTypePropertiesResult.get();
-        ToscaExportUtils.addInputsToProperties(dataTypes, service.getInputs(), proxyNodeTypeProperties);
-        Assert.assertNotNull(proxyNodeTypeProperties);
-        Assert.assertEquals(4, proxyNodeTypeProperties.size());
-        Assert.assertNotNull(proxyNodeTypeProperties.get("componentInputStr1"));
-        Assert.assertNotNull(proxyNodeTypeProperties.get("componentInputStr2"));
-    }
-
-    @Test
-    public void testAddInputsToPropertiesOnlyInputs() {
-        Component service = getTestComponent();
-        service.setInputs(Arrays.asList(createMockInput("componentInputStr1",
-                "Default String Input1"), createMockInput("componentInputStr2", "Default String Input2")));
-        Optional<Map<String, ToscaProperty>> proxyNodeTypePropertiesResult =
-                ToscaExportUtils.getProxyNodeTypeProperties(service, dataTypes);
-
-        Assert.assertTrue(proxyNodeTypePropertiesResult.isPresent());
-        Map<String, ToscaProperty> proxyNodeTypeProperties = proxyNodeTypePropertiesResult.get();
-        ToscaExportUtils.addInputsToProperties(dataTypes, service.getInputs(), proxyNodeTypeProperties);
-        Assert.assertNotNull(proxyNodeTypeProperties);
-        Assert.assertEquals(2, proxyNodeTypeProperties.size());
-        Assert.assertNotNull(proxyNodeTypeProperties.get("componentInputStr1"));
-        Assert.assertNotNull(proxyNodeTypeProperties.get("componentInputStr2"));
-    }
-
-    @Test
-    public void testOperationImplementationInProxyNodeTypeNotPresent() {
-        Component service = getTestComponent();
-        InterfaceDefinition interfaceDefinition =
-                service.getInterfaces().get("normalizedServiceComponentName-interface");
-        interfaceDefinition.setOperations(new HashMap<>());
-        final OperationDataDefinition operation = new OperationDataDefinition();
-        operation.setName("start");
-        operation.setDescription("op description");
-        final ArtifactDataDefinition implementation = new ArtifactDataDefinition();
-        implementation.setArtifactName("createBPMN.bpmn");
-        operation.setImplementation(implementation);
-        interfaceDefinition.getOperations().put(operation.getName(), operation);
-        service.getInterfaces().put("normalizedServiceComponentName-interface", interfaceDefinition);
-        service.setInputs(Arrays.asList(createMockInput("componentInputStr1",
-                "Default String Input1"), createMockInput("componentInputStr2", "Default String Input2")));
-        Optional<Map<String, Object>> proxyNodeTypeInterfaces =
-                ToscaExportUtils.getProxyNodeTypeInterfaces(service, dataTypes);
-        Assert.assertTrue(proxyNodeTypeInterfaces.isPresent());
-        Map<String, Object> componentInterfaces = proxyNodeTypeInterfaces.get();
-        Assert.assertNotNull(componentInterfaces);
-        Assert.assertEquals(1, componentInterfaces.size());
-        Map<String, Object> proxyInterfaceDefinition =
-                (Map<String, Object>) componentInterfaces.get("serviceName");
-        Map<String, Object> startOperationDefinition = (Map<String, Object>) proxyInterfaceDefinition.get("start");
-        Assert.assertNotNull(startOperationDefinition);
-        Assert.assertNull(startOperationDefinition.get("implementation"));
-    }
-
-    private Component getTestComponent() {
-        Component component = new Service();
-        component.setNormalizedName("normalizedServiceComponentName");
-        InterfaceDefinition addedInterface = new InterfaceDefinition();
-        addedInterface.setType("com.some.service.or.other.serviceName");
-        final String interfaceType = "normalizedServiceComponentName-interface";
-        component.setInterfaces(new HashMap<>());
-        component.getInterfaces().put(interfaceType, addedInterface);
-        return component;
-    }
-
-    private PropertyDefinition createMockProperty(String propertyName, String defaultValue){
-        PropertyDefinition propertyDefinition = new PropertyDefinition();
-        propertyDefinition.setName(propertyName);
-        propertyDefinition.setType("string");
-        propertyDefinition.setDefaultValue(defaultValue);
-        return propertyDefinition;
-    }
-
-    private InputDefinition createMockInput(String inputName, String defaultValue){
-        InputDefinition inputDefinition = new InputDefinition();
-        inputDefinition.setName(inputName);
-        inputDefinition.setType("string");
-        inputDefinition.setDefaultValue(defaultValue);
-        return inputDefinition;
-    }
-}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsConverterTest.java
similarity index 93%
rename from catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java
rename to catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsConverterTest.java
index d6a7b86..13bc009 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsConverterTest.java
@@ -24,6 +24,8 @@
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.be.DummyConfigurationManager;
 import org.openecomp.sdc.be.config.Configuration;
@@ -40,6 +42,8 @@
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.ServiceMetadataDefinition;
 import org.openecomp.sdc.be.model.tosca.ToscaFunctions;
+import org.openecomp.sdc.be.tosca.InterfacesOperationsConverter;
+import org.openecomp.sdc.be.tosca.PropertyConvertor;
 import org.openecomp.sdc.be.tosca.ToscaExportHandler;
 import org.openecomp.sdc.be.tosca.ToscaRepresentation;
 import org.openecomp.sdc.be.tosca.model.ToscaNodeType;
@@ -55,11 +59,10 @@
 
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.SELF;
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.addInterfaceDefinitionElement;
-import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.addInterfaceTypeElement;
-
-public class InterfacesOperationsToscaUtilTest {
+import static org.openecomp.sdc.be.tosca.InterfacesOperationsConverter.SELF;
+import static org.openecomp.sdc.be.tosca.InterfacesOperationsConverter.addInterfaceTypeElement;
+@RunWith(MockitoJUnitRunner.class)
+public class InterfacesOperationsConverterTest {
 
     private static final String MAPPED_PROPERTY_NAME = "mapped_property";
     private static final String INPUT_NAME_PREFIX = "input_";
@@ -71,21 +74,20 @@
     DummyConfigurationManager dummyConfigurationManager = new DummyConfigurationManager();
     private static final Map<String, DataTypeDefinition> dataTypes = new HashMap<>();
 
+    private InterfacesOperationsConverter interfacesOperationsConverter;
 
     @BeforeClass
     public static void setUp() {
         mapper = new ObjectMapper();
         mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
     }
+
     @Before
-    public void beforeTest() {
-        when(environmentContext.getDefaultValue()).thenReturn("General_Revenue-Bearing");
-        when(dummyConfigurationManager.getConfigurationMock().getEnvironmentContext())
-                .thenReturn(environmentContext);
+    public void setUpBeforeTest() {
+        interfacesOperationsConverter =
+                new InterfacesOperationsConverter(new PropertyConvertor());
     }
 
-
     @Test
     public void addInterfaceTypeElementToResource() {
         Component component = new Resource();
@@ -102,7 +104,8 @@
         final Map<String, Object> interfaceTypeElement =
                 addInterfaceTypeElement(component, new ArrayList<>());
 
-        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
+        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null, null,
+                interfacesOperationsConverter);
         ToscaTemplate template = new ToscaTemplate("test");
         template.setInterface_types(interfaceTypeElement);
         final ToscaRepresentation toscaRepresentation = handler.createToscaRepresentation(template);
@@ -127,7 +130,8 @@
         final Map<String, Object> interfaceTypeElement =
                 addInterfaceTypeElement(component, new ArrayList<>());
 
-        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
+        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null, null,
+                interfacesOperationsConverter);
         ToscaTemplate template = new ToscaTemplate("testService");
         template.setInterface_types(interfaceTypeElement);
         final ToscaRepresentation toscaRepresentation = handler.createToscaRepresentation(template);
@@ -148,9 +152,10 @@
         component.setInterfaces(new HashMap<>());
         component.getInterfaces().put(interfaceType, addedInterface);
         ToscaNodeType nodeType = new ToscaNodeType();
-        addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
+        interfacesOperationsConverter.addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
 
-        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
+        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null, null,
+                interfacesOperationsConverter);
         ToscaTemplate template = new ToscaTemplate(NODE_TYPE_NAME);
         Map<String, ToscaNodeType> nodeTypes = new HashMap<>();
         nodeTypes.put(NODE_TYPE_NAME, nodeType);
@@ -179,9 +184,10 @@
         component.setInterfaces(new HashMap<>());
         component.getInterfaces().put(interfaceType, addedInterface);
         ToscaNodeType nodeType = new ToscaNodeType();
-        addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
+        interfacesOperationsConverter.addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
 
-        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
+        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null, null,
+                interfacesOperationsConverter);
         ToscaTemplate template = new ToscaTemplate("testService");
         Map<String, ToscaNodeType> nodeTypes = new HashMap<>();
         nodeTypes.put(NODE_TYPE_NAME, nodeType);
@@ -210,7 +216,7 @@
         final String interfaceType = "normalizedComponentName-interface";
         component.setInterfaces(new HashMap<>());
         component.getInterfaces().put(interfaceType, addedInterface);
-        Map<String, Object> interfacesMap = InterfacesOperationsToscaUtil
+        Map<String, Object> interfacesMap = interfacesOperationsConverter
                 .getInterfacesMap(component, null, component.getInterfaces(), null, false, true);
         ToscaNodeType nodeType = new ToscaNodeType();
         nodeType.setInterfaces(interfacesMap);
@@ -243,9 +249,10 @@
         component.setInterfaces(new HashMap<>());
         component.getInterfaces().put(interfaceType, addedInterface);
         ToscaNodeType nodeType = new ToscaNodeType();
-        addInterfaceDefinitionElement(component, nodeType, null, false);
+        interfacesOperationsConverter.addInterfaceDefinitionElement(component, nodeType, null, false);
 
-        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
+        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null, null,
+                interfacesOperationsConverter);
         ToscaTemplate template = new ToscaTemplate("test");
         Map<String, ToscaNodeType> nodeTypes = new HashMap<>();
         nodeTypes.put("test", nodeType);
@@ -278,9 +285,10 @@
         component.setInterfaces(new HashMap<>());
         component.getInterfaces().put(addedInterfaceType, addedInterface);
         ToscaNodeType nodeType = new ToscaNodeType();
-        addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
+        interfacesOperationsConverter.addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
 
-        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
+        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null, null,
+                interfacesOperationsConverter);
         ToscaTemplate template = new ToscaTemplate("test");
         Map<String, ToscaNodeType> nodeTypes = new HashMap<>();
         nodeTypes.put("test", nodeType);
@@ -325,9 +333,10 @@
         component.getInterfaces().put(secondInterfaceType, secondInterface);
 
         ToscaNodeType nodeType = new ToscaNodeType();
-        addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
+        interfacesOperationsConverter.addInterfaceDefinitionElement(component, nodeType, dataTypes, false);
 
-        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
+        ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null, null,
+                interfacesOperationsConverter);
         ToscaTemplate template = new ToscaTemplate("test");
         Map<String, ToscaNodeType> nodeTypes = new HashMap<>();
         nodeTypes.put("test", nodeType);
@@ -519,7 +528,7 @@
         service.getComponentMetadataDefinition().getMetadataDataDefinition().setSystemName("LocalInterface");
         service.setInterfaces(Collections.singletonMap("Local", new InterfaceDefinition("Local", null, new HashMap<>())));
 
-        Map<String, Object> resultMap = InterfacesOperationsToscaUtil.addInterfaceTypeElement(service,
+        Map<String, Object> resultMap = InterfacesOperationsConverter.addInterfaceTypeElement(service,
                 Collections.singletonList("org.openecomp.interfaces.node.lifecycle.Standard"));
 
         Assert.assertTrue(MapUtils.isNotEmpty(resultMap)
@@ -534,7 +543,7 @@
         service.setInterfaces(Collections.singletonMap("NotLocal", new InterfaceDefinition("NotLocal", null,
                 new HashMap<>())));
 
-        Map<String, Object> resultMap = InterfacesOperationsToscaUtil.getInterfacesMap(service, null,
+        Map<String, Object> resultMap = interfacesOperationsConverter.getInterfacesMap(service, null,
                 service.getInterfaces(), null, false, false);
 
         Assert.assertTrue(MapUtils.isNotEmpty(resultMap)
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
index c138617..5d9453a 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
@@ -29,9 +29,13 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
 
+@EqualsAndHashCode(callSuper = false)
+@Data
 public class PropertyDataDefinition extends ToscaDataDefinition {
 
     private String uniqueId;
@@ -125,121 +129,25 @@
         this.setIsDeclaredListInput(propertyDataDefinition.getIsDeclaredListInput());
     }
 
-    public String getParentPropertyType() {
-        return parentPropertyType;
-    }
-
-    public void setParentPropertyType(String parentPropertyType) {
-        this.parentPropertyType = parentPropertyType;
-    }
-
-    public String getSubPropertyInputPath() {
-        return subPropertyInputPath;
-    }
-
-    public void setSubPropertyInputPath(String subPropertyInputPath) {
-        this.subPropertyInputPath = subPropertyInputPath;
-    }
-
-    public String getInputPath() {
-        return inputPath;
-    }
-
-    public void setInputPath(String inputPath) {
-        this.inputPath = inputPath;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
     // @Override
     public boolean isDefinition() {
         return true;
     }
 
-    public void setDefinition(boolean definition) {
-        this.definition = definition;
-    }
-
-	public boolean getDefinition() {
-		return definition;
-	}
-
-    public String getType() {
-        return type;
-    }
-
-    public String getDefaultValue() {
-        return defaultValue;
-    }
-
-    public void setDefaultValue(String defaultValue) {
-        this.defaultValue = defaultValue;
-    }
-
-    public void setType(String type) {
-        this.type = type;
+    public boolean getDefinition() {
+        return definition;
     }
 
     public Boolean isRequired() {
         return required;
     }
 
-    public void setRequired(Boolean required) {
-        this.required = required;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public boolean isPassword() {
-        return password;
-    }
-
-    public void setPassword(boolean password) {
-        this.password = password;
-    }
-
-    public String getUniqueId() {
-        return uniqueId;
-    }
-
-    public void setUniqueId(String uniqueId) {
-        this.uniqueId = uniqueId;
-    }
-
-    public SchemaDefinition getSchema() {
-        return schema;
-    }
-
     public void setSchemaType(String schemaType) {
         if (schema != null && schema.getProperty() != null) {
             schema.getProperty().setType(schemaType);
         }
     }
 
-    public void setSchema(SchemaDefinition entrySchema) {
-        this.schema = entrySchema;
-    }
-
     public String getSchemaType() {
         if (schema != null && schema.getProperty() != null) {
             return schema.getProperty().getType();
@@ -255,30 +163,14 @@
         return null;
     }
 
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
     public Boolean isHidden() {
         return hidden;
     }
 
-    public void setHidden(Boolean hidden) {
-        this.hidden = hidden;
-    }
-
     public Boolean isImmutable() {
         return immutable;
     }
 
-    public void setImmutable(Boolean immutable) {
-        this.immutable = immutable;
-    }
-
     public String getParentUniqueId() {
         return getOwnerId();
     }
@@ -287,95 +179,10 @@
         setOwnerId(parentUniqueId);
     }
 
-    public List<GetInputValueDataDefinition> getGetInputValues() {
-        return getInputValues;
-    }
-
-    public void setGetInputValues(List<GetInputValueDataDefinition> getInputValues) {
-        this.getInputValues = getInputValues;
-    }
-
     public List<GetPolicyValueDataDefinition> safeGetGetPolicyValues() {
         return CollectionUtils.isEmpty(getPolicyValues) ? new ArrayList<>() : getPolicyValues;
     }
 
-    public List<GetPolicyValueDataDefinition> getGetPolicyValues() {
-        return getPolicyValues;
-    }
-
-    public void setGetPolicyValues(List<GetPolicyValueDataDefinition> getPolicyValues) {
-        this.getPolicyValues = getPolicyValues;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getInputId() {
-        return inputId;
-    }
-
-    public void setInputId(String inputId) {
-        this.inputId = inputId;
-    }
-
-    public String getInstanceUniqueId() {
-        return instanceUniqueId;
-    }
-
-    public void setInstanceUniqueId(String instanceUniqueId) {
-        this.instanceUniqueId = instanceUniqueId;
-    }
-
-    public String getPropertyId() {
-        return propertyId;
-    }
-
-    public void setPropertyId(String propertyId) {
-        this.propertyId = propertyId;
-    }
-
-    public Boolean getIsDeclaredListInput() {
-        return isDeclaredListInput;
-    }
-
-    public void setIsDeclaredListInput(Boolean isDeclaredListInput) {
-        this.isDeclaredListInput = isDeclaredListInput;
-    }
-
-    @Override
-    public String toString() {
-        return "PropertyDataDefinition [uniqueId=" + uniqueId + ", type=" + type + ", required=" + required + ", definition=" + definition + ", defaultValue=" + defaultValue + ", description=" + description + ", schema=" + schema + ", password="
-                + password + ", name=" + name + ", value=" + value + ", label=" + label + ", hidden=" + hidden + ", immutable=" + immutable + ", inputPath=" + inputPath + ", status=" + status + ", inputId=" + inputId + ", instanceUniqueId="
-                + instanceUniqueId + ", propertyId=" + propertyId + ", parentUniqueId=" + parentUniqueId + ", getInputValues=" + getInputValues + ", isDeclaredListInput=" + isDeclaredListInput
-                + ", parentPropertyType=" + parentPropertyType
-                + ", subPropertyInputPath=" + subPropertyInputPath + "]";
-    }
-
-    @Override
-    public int hashCode() {
-        final int hashingValueDefinition = 1231;
-        final int hashingValueNoDefinition = 1237;
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((defaultValue == null) ? 0 : defaultValue.hashCode());
-        result = prime * result + (definition ? hashingValueDefinition : hashingValueNoDefinition);
-        result = prime * result + ((description == null) ? 0 : description.hashCode());
-        result = prime * result + (password ? hashingValueDefinition : hashingValueNoDefinition);
-        result = prime * result + ((required == null) ? 0 : required.hashCode());
-        result = prime * result + ((schema == null) ? 0 : schema.hashCode());
-        result = prime * result + ((type == null) ? 0 : type.hashCode());
-        result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
-        result = prime * result + ((parentUniqueId == null) ? 0 : parentUniqueId.hashCode());
-        result = prime * result + ((status == null) ? 0 : status.hashCode());
-        result = prime * result + ((isDeclaredListInput == null) ? 0 : isDeclaredListInput.hashCode());
-        return result;
-    }
-
     public boolean typeEquals(Object obj) {
         if (this == obj) {
             return true;
@@ -402,90 +209,6 @@
     }
 
     @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        PropertyDataDefinition other = (PropertyDataDefinition) obj;
-        if (defaultValue == null) {
-            if (other.defaultValue != null) {
-                return false;
-            }
-        } else if (!defaultValue.equals(other.defaultValue)) {
-            return false;
-        }
-        if (definition != other.definition) {
-            return false;
-        }
-        if (description == null) {
-            if (other.description != null) {
-                return false;
-            }
-        } else if (!description.equals(other.description)) {
-            return false;
-        }
-        if (password != other.password) {
-            return false;
-        }
-        if (required == null) {
-            if (other.required != null) {
-                return false;
-            }
-        } else if (!required.equals(other.required)) {
-            return false;
-        }
-        if (schema == null) {
-            if (other.schema != null) {
-                return false;
-            }
-        } else if (!schema.equals(other.schema)) {
-            return false;
-        }
-        if (type == null) {
-            if (other.type != null) {
-                return false;
-            }
-        } else if (!type.equals(other.type)) {
-            return false;
-        }
-        if (parentUniqueId == null) {
-            if (other.parentUniqueId != null) {
-                return false;
-            }
-        } else if (!parentUniqueId.equals(other.parentUniqueId)) {
-            return false;
-        }
-        if (uniqueId == null) {
-            if (other.uniqueId != null) {
-                return false;
-            }
-        } else if (!uniqueId.equals(other.uniqueId)) {
-            return false;
-        }
-        if (status == null) {
-            if (other.status != null) {
-                return false;
-            }
-        } else if (!status.equals(other.status)) {
-            return false;
-        }
-        if (isDeclaredListInput == null) {
-            if (other.isDeclaredListInput != null) {
-                return false;
-            }
-        } else if (!isDeclaredListInput.equals(other.isDeclaredListInput)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
     public Object getToscaPresentationValue(JsonPresentationFields field) {
         switch (field) {
             case NAME:
@@ -571,9 +294,7 @@
         Set<Annotation> annotationSet = isNotEmpty(newAnnotations) ? new HashSet<>(newAnnotations) : new HashSet<>();
         //We would to prioritize the new valid annotations over the old ones if the same one existed.
         if (this.annotations != null) {
-            for (Annotation oldInputAnnotation : this.annotations) {
-                annotationSet.add(oldInputAnnotation);
-            }
+            annotationSet.addAll(this.annotations);
         }
 
         this.annotations = new ArrayList<>(annotationSet);
@@ -583,12 +304,4 @@
     public List<Annotation> getAnnotations() {
         return (List<Annotation>) getToscaPresentationValue(JsonPresentationFields.ANNOTATIONS);
     }
-
-	public List<String> getPropertyConstraints() {
-		return propertyConstraints;
-	}
-
-	public void setPropertyConstraints(List<String> constraints) {
-		this.propertyConstraints = constraints;
-	}
 }
diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java
index 899022e..2e8b26f 100644
--- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java
+++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java
@@ -623,7 +623,8 @@
 		Assert.assertEquals(false, result);
 		result = testSubject.equals(testSubject);
 		Assert.assertEquals(true, result);
-		result = testSubject.equals(createTestSubject());
+		PropertyDataDefinition other = createTestSubject();
+		result = testSubject.equals(other);
 		Assert.assertEquals(true, result);
 	}
 
