diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Extractor.java b/src/main/java/org/onap/clamp/clds/tosca/update/Extractor.java
deleted file mode 100644
index c6eabcd..0000000
--- a/src/main/java/org/onap/clamp/clds/tosca/update/Extractor.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights
- *                             reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END============================================
- * ===================================================================
- *
- */
-
-package org.onap.clamp.clds.tosca.update;
-
-import java.util.LinkedHashMap;
-import java.util.Map.Entry;
-import org.yaml.snakeyaml.Yaml;
-
-public class Extractor {
-    private LinkedHashMap<String, Component> allItems;
-    private String source;
-    private String nativeComponent;
-
-    /**
-     * Constructor.
-     *
-     * @param toParse Tosca to parse
-     * @param nativeComponent The policy type to scan
-     */
-    public Extractor(String toParse, String nativeComponent) {
-
-        this.source = toParse;
-        this.nativeComponent = nativeComponent;
-        allItems = new LinkedHashMap<String, Component>();
-        getAllAsMaps();
-    }
-
-    public LinkedHashMap<String, Component> getAllItems() {
-        return allItems;
-    }
-
-    public String getSource() {
-        return source;
-    }
-
-    /**
-     * Yaml Parse gets raw policies and datatypes, in different sections : necessary to extract
-     * all entities and put them at the same level.
-     *
-     * @return an object
-     */
-    @SuppressWarnings("unchecked")
-    public LinkedHashMap<String, Object> getAllAsMaps() {
-        Yaml yaml = new Yaml();
-        Object contentFile = yaml.load(source);
-        LinkedHashMap<String, LinkedHashMap<String, Object>> file =
-                (LinkedHashMap<String, LinkedHashMap<String, Object>>) contentFile;
-        // Get DataTypes
-        LinkedHashMap<String, Object> dataTypes = file.get("data_types");
-        dataTypes = (dataTypes == null) ? (new LinkedHashMap<>()) : dataTypes;
-        // Get Policies : first, get topology and after extract policies from it
-        LinkedHashMap<String, Object> policyTypes = file.get("policy_types");
-        // Put the policies and datatypes in the same collection
-        dataTypes.putAll(policyTypes);
-
-        Object contentNativeFile = yaml.load(nativeComponent);
-        LinkedHashMap<String, Object> dataTypesEmbedded =
-                ((LinkedHashMap<String, LinkedHashMap<String, Object>>) contentNativeFile).get("data_types");
-        dataTypes.putAll(dataTypesEmbedded);
-
-        parseInComponent(dataTypes);
-        return dataTypes;
-    }
-
-    /**
-     * With all the component, get as Map, Components and Components properties are created.
-     *
-     * @param allMaps maps
-     */
-    @SuppressWarnings("unchecked")
-    public void parseInComponent(LinkedHashMap<String, Object> allMaps) {
-        //Component creations, from the file maps
-        for (Entry<String, Object> itemToParse : allMaps.entrySet()) {
-            LinkedHashMap<String, Object> componentBody = (LinkedHashMap<String, Object>) itemToParse.getValue();
-            Component component = new Component(itemToParse.getKey(), (String) componentBody.get("derived_from"),
-                    (String) componentBody.get("description"));
-            //If policy, version and type_version :
-            if (componentBody.get("type_version") != null) {
-                component.setVersion((String) componentBody.get("type_version"));
-                component.setTypeVersion((String) componentBody.get("type_version"));
-            }
-            //Properties creation, from the map
-            if (componentBody.get("properties") != null) {
-                LinkedHashMap<String, Object> properties =
-                        (LinkedHashMap<String, Object>) componentBody.get("properties");
-                for (Entry<String, Object> itemToProperty : properties.entrySet()) {
-                    Property property = new Property(itemToProperty.getKey(),
-                            (LinkedHashMap<String, Object>) itemToProperty.getValue());
-                    component.addProperties(property);
-                }
-            }
-            this.allItems.put(component.getName(), component);
-        }
-    }
-}
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/MetadataParser.java b/src/main/java/org/onap/clamp/clds/tosca/update/MetadataParser.java
new file mode 100644
index 0000000..fb70231
--- /dev/null
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/MetadataParser.java
@@ -0,0 +1,46 @@
+
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.tosca.update;
+
+import com.google.gson.JsonObject;
+import org.onap.clamp.tosca.DictionaryService;
+
+public class MetadataParser {
+
+    /**
+     * This method is used to start the processing of the metadata field.
+     *
+     * @param property          The property metadata as Json Object
+     * @param dictionaryService the Dictionary service, if null nothing will be done
+     * @return The jsonObject structure that must be added to the json schema
+     */
+    public static JsonObject processAllMetadataElement(Property property, DictionaryService dictionaryService) {
+        if (dictionaryService != null) {
+            return null;
+        } else {
+            return null;
+        }
+    }
+}
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Template.java b/src/main/java/org/onap/clamp/clds/tosca/update/Template.java
index 4507e3d..6a531ae 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/Template.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/Template.java
@@ -33,16 +33,16 @@
      * name parameter is used as "key", in the LinkedHashMap of Templates.
      */
     private String name;
-    private List<Field> fields;
+    private List<TemplateField> templateFields;
 
     public Template(String name) {
         this.name = name;
-        this.fields = new ArrayList<>();
+        this.templateFields = new ArrayList<>();
     }
 
-    public Template(String name, List<Field> fields) {
+    public Template(String name, List<TemplateField> templateFields) {
         this.name = name;
-        this.fields = fields;
+        this.templateFields = templateFields;
     }
 
     public String getName() {
@@ -53,12 +53,12 @@
         this.name = name;
     }
 
-    public List<Field> getFields() {
-        return fields;
+    public List<TemplateField> getTemplateFields() {
+        return templateFields;
     }
 
-    public void setFields(List<Field> fields) {
-        this.fields = fields;
+    public void setTemplateFields(List<TemplateField> templateFields) {
+        this.templateFields = templateFields;
     }
 
     /**
@@ -68,8 +68,8 @@
      * @return Ture if it exists, false otherwise
      */
     public boolean hasFields(String fieldName) {
-        for (Field field : this.getFields()) {
-            if (field.getTitle().equals(fieldName)) {
+        for (TemplateField templateField : this.getTemplateFields()) {
+            if (templateField.getTitle().equals(fieldName)) {
                 return true;
             }
         }
@@ -82,21 +82,21 @@
      * @param fieldName The field name
      * @return THe Field found
      */
-    public Field getSpecificField(String fieldName) {
-        for (Field field : this.getFields()) {
-            if (field.getTitle().equals(fieldName)) {
-                return field;
+    public TemplateField getSpecificField(String fieldName) {
+        for (TemplateField templateField : this.getTemplateFields()) {
+            if (templateField.getTitle().equals(fieldName)) {
+                return templateField;
             }
         }
         return null;
     }
 
-    public void addField(Field field) {
-        fields.add(field);
+    public void addField(TemplateField templateField) {
+        templateFields.add(templateField);
     }
 
-    public void removeField(Field field) {
-        fields.remove(field);
+    public void removeField(TemplateField templateField) {
+        templateFields.remove(templateField);
     }
 
     /**
@@ -106,9 +106,9 @@
      * @param state True or false
      */
     public void setVisibility(String nameField, boolean state) {
-        for (Field field : this.fields) {
-            if (field.getTitle().equals(nameField)) {
-                field.setVisible(state);
+        for (TemplateField templateField : this.templateFields) {
+            if (templateField.getTitle().equals(nameField)) {
+                templateField.setVisible(state);
             }
         }
     }
@@ -120,9 +120,9 @@
      * @param state true or false
      */
     public void setStatic(String nameField, boolean state) {
-        for (Field field : this.fields) {
-            if (field.getTitle().equals(nameField)) {
-                field.setStaticValue(state);
+        for (TemplateField templateField : this.templateFields) {
+            if (templateField.getTitle().equals(nameField)) {
+                templateField.setStaticValue(state);
             }
         }
     }
@@ -134,9 +134,9 @@
      * @param newValue The new value as Object
      */
     public void updateValueField(String nameField, Object newValue) {
-        for (Field field : this.fields) {
-            if (field.getTitle().equals(nameField)) {
-                field.setValue(newValue);
+        for (TemplateField templateField : this.templateFields) {
+            if (templateField.getTitle().equals(nameField)) {
+                templateField.setValue(newValue);
             }
         }
     }
@@ -149,18 +149,18 @@
      */
     public boolean checkFields(Template template) {
         boolean duplicateFields = false;
-        if (template.getFields().size() == this.getFields().size()) {
+        if (template.getTemplateFields().size() == this.getTemplateFields().size()) {
             int countMatchingFields = 0;
             //loop each component of first
-            for (Field templateFieldToCheck : template.getFields()) {
-                for (Field templateField : this.getFields()) {
+            for (TemplateField templateFieldToCheck : template.getTemplateFields()) {
+                for (TemplateField templateField : this.getTemplateFields()) {
                     if (templateFieldToCheck.compareWithField(templateField)) {
                         countMatchingFields++;
                     }
                 }
             }
 
-            if (template.getFields().size() == countMatchingFields) {
+            if (template.getTemplateFields().size() == countMatchingFields) {
                 duplicateFields = true;
             }
         }
@@ -212,13 +212,13 @@
      */
     public void injectStaticValue(JsonObject jsonSchema, String fieldName) {
         if (isVisible(fieldName)) {
-            Field toInject = this.getSpecificField(fieldName);
+            TemplateField toInject = this.getSpecificField(fieldName);
             jsonSchema.addProperty(fieldName, (String) toInject.getValue());
         }
     }
 
     @Override
     public String toString() {
-        return " fields : " + fields;
+        return " templateFields : " + templateFields;
     }
 }
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Field.java b/src/main/java/org/onap/clamp/clds/tosca/update/TemplateField.java
similarity index 71%
rename from src/main/java/org/onap/clamp/clds/tosca/update/Field.java
rename to src/main/java/org/onap/clamp/clds/tosca/update/TemplateField.java
index e01f14c..3444643 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/Field.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/TemplateField.java
@@ -23,13 +23,13 @@
 
 package org.onap.clamp.clds.tosca.update;
 
-public class Field {
+public class TemplateField {
     private String title;
     private Object value;
     private Boolean visible;
     private Boolean staticValue;
 
-    public Field(String title) {
+    public TemplateField(String title) {
         this.title = title;
     }
 
@@ -41,7 +41,7 @@
      * @param visible     visible or not
      * @param staticValue The static value
      */
-    public Field(String title, Object value, Boolean visible, Boolean staticValue) {
+    public TemplateField(String title, Object value, Boolean visible, Boolean staticValue) {
         this.title = title;
         this.value = value;
         this.visible = visible;
@@ -98,18 +98,18 @@
             return false;
         }
 
-        Field field = (Field) otherField;
+        TemplateField templateField = (TemplateField) otherField;
 
-        if (title != null ? !title.equals(field.title) : field.title != null) {
+        if (title != null ? !title.equals(templateField.title) : templateField.title != null) {
             return false;
         }
-        if (value != null ? !value.equals(field.value) : field.value != null) {
+        if (value != null ? !value.equals(templateField.value) : templateField.value != null) {
             return false;
         }
-        if (visible != null ? !visible.equals(field.visible) : field.visible != null) {
+        if (visible != null ? !visible.equals(templateField.visible) : templateField.visible != null) {
             return false;
         }
-        return staticValue != null ? staticValue.equals(field.staticValue) : field.staticValue == null;
+        return staticValue != null ? staticValue.equals(templateField.staticValue) : templateField.staticValue == null;
     }
 
     @Override
@@ -121,9 +121,9 @@
             return false;
         }
 
-        Field field = (Field) object;
+        TemplateField templateField = (TemplateField) object;
 
-        return title != null ? title.equals(field.title) : field.title == null;
+        return title != null ? title.equals(templateField.title) : templateField.title == null;
     }
 
     @Override
@@ -134,14 +134,15 @@
     /**
      * This method test the entire equality.
      *
-     * @param field1 object one
-     * @param field2 object two
+     * @param templateField1 object one
+     * @param templateField2 object two
      * @return true if they are totally equals (all attributes, false otherwise
      */
-    public static boolean fieldsEquals(Field field1, Field field2) {
-        return (field2.getTitle().equals(field1.getTitle()) && field2.getValue().equals(field1.getValue())
-                && field2.getVisible().equals(field1.getVisible())
-                && field2.getStaticValue().equals(field1.getStaticValue()));
+    public static boolean fieldsEquals(TemplateField templateField1, TemplateField templateField2) {
+        return (templateField2.getTitle().equals(templateField1.getTitle())
+                && templateField2.getValue().equals(templateField1.getValue())
+                && templateField2.getVisible().equals(templateField1.getVisible())
+                && templateField2.getStaticValue().equals(templateField1.getStaticValue()));
     }
 
 }
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/TemplateManagement.java b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterManager.java
similarity index 66%
rename from src/main/java/org/onap/clamp/clds/tosca/update/TemplateManagement.java
rename to src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterManager.java
index 7430771..b3224b0 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/TemplateManagement.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterManager.java
@@ -32,25 +32,26 @@
 import java.util.Map;
 import org.onap.clamp.clds.util.JsonUtils;
 
-public class TemplateManagement {
+public class ToscaConverterManager {
 
     private LinkedHashMap<String, Template> templates;
-    private LinkedHashMap<String, Component> components;
-    private ParserToJson parserToJson;
-    private Extractor extractor;
+    private LinkedHashMap<String, ToscaElement> components;
+    private ToscaConverterToJson toscaConverterToJson;
+    private ToscaItemsParser toscaItemsParser;
 
     /**
      * Constructor.
      *
-     * @param yamlContent        Yaml content as string
-     * @param templateProperties template properties as string
+     * @param toscaYamlContent     Policy Tosca Yaml content as string
+     * @param nativeToscaDatatypes The tosca yaml with tosca native datatypes
+     * @param templateProperties   template properties as string
      * @throws IOException in case of failure
      */
-    public TemplateManagement(String yamlContent, String nativeComponent, String templateProperties)
+    public ToscaConverterManager(String toscaYamlContent, String nativeToscaDatatypes, String templateProperties)
             throws IOException {
-        if (yamlContent != null && !yamlContent.isEmpty()) {
-            this.extractor = new Extractor(yamlContent, nativeComponent);
-            this.components = extractor.getAllItems();
+        if (toscaYamlContent != null && !toscaYamlContent.isEmpty()) {
+            this.toscaItemsParser = new ToscaItemsParser(toscaYamlContent, nativeToscaDatatypes);
+            this.components = toscaItemsParser.getAllItemsFound();
             this.templates = initializeTemplates(templateProperties);
         }
         else {
@@ -59,20 +60,20 @@
     }
 
     //GETTERS & SETTERS
-    public LinkedHashMap<String, Component> getComponents() {
+    public LinkedHashMap<String, ToscaElement> getComponents() {
         return components;
     }
 
-    public void setComponents(LinkedHashMap<String, Component> components) {
+    public void setComponents(LinkedHashMap<String, ToscaElement> components) {
         this.components = components;
     }
 
-    public ParserToJson getParseToJson() {
-        return parserToJson;
+    public ToscaConverterToJson getParseToJson() {
+        return toscaConverterToJson;
     }
 
-    public void setParseToJson(ParserToJson parserToJson) {
-        this.parserToJson = parserToJson;
+    public void setParseToJson(ToscaConverterToJson toscaConverterToJson) {
+        this.toscaConverterToJson = toscaConverterToJson;
     }
 
     public LinkedHashMap<String, Template> getTemplates() {
@@ -83,18 +84,18 @@
         this.templates = templates;
     }
 
-    public Extractor getExtractor() {
-        return extractor;
+    public ToscaItemsParser getToscaItemsParser() {
+        return toscaItemsParser;
     }
 
     /**
      * Add a template.
      *
-     * @param name   name
-     * @param fields fields
+     * @param name           name
+     * @param templateFields fields
      */
-    public void addTemplate(String name, List<Field> fields) {
-        Template template = new Template(name, fields);
+    public void addTemplate(String name, List<TemplateField> templateFields) {
+        Template template = new Template(name, templateFields);
         //If it is true, the operation does not have any interest :
         // replace OR put two different object with the same body
         if (!templates.containsKey(template.getName()) || !this.hasTemplate(template)) {
@@ -114,18 +115,18 @@
     /**
      * Update Template : adding with true flag, removing with false.
      *
-     * @param nameTemplate name template
-     * @param field        field name
-     * @param operation    operation
+     * @param nameTemplate  name template
+     * @param templateField field name
+     * @param operation     operation
      */
-    public void updateTemplate(String nameTemplate, Field field, Boolean operation) {
+    public void updateTemplate(String nameTemplate, TemplateField templateField, Boolean operation) {
         // Operation = true && field is not present => add Field
-        if (operation && !this.templates.get(nameTemplate).getFields().contains(field)) {
-            this.templates.get(nameTemplate).addField(field);
+        if (operation && !this.templates.get(nameTemplate).getTemplateFields().contains(templateField)) {
+            this.templates.get(nameTemplate).addField(templateField);
         }
         // Operation = false && field is present => remove Field
-        else if (!operation && this.templates.get(nameTemplate).getFields().contains(field)) {
-            this.templates.get(nameTemplate).removeField(field);
+        else if (!operation && this.templates.get(nameTemplate).getTemplateFields().contains(templateField)) {
+            this.templates.get(nameTemplate).removeField(templateField);
         }
     }
 
@@ -151,12 +152,12 @@
      * @param componentName name
      * @return an json object
      */
-    public JsonObject launchTranslation(String componentName) throws UnknownComponentException {
-        this.parserToJson = new ParserToJson(components, templates);
-        if (parserToJson.matchComponent(componentName) == null) {
+    public JsonObject startConversionToJson(String componentName) throws UnknownComponentException {
+        this.toscaConverterToJson = new ToscaConverterToJson(components, templates);
+        if (toscaConverterToJson.matchComponent(componentName) == null) {
             throw new UnknownComponentException(componentName);
         }
-        return parserToJson.getJsonProcess(componentName, "object");
+        return toscaConverterToJson.getJsonProcess(componentName, "object");
     }
 
     /**
@@ -180,8 +181,8 @@
                 Object fieldValue = bodyFieldAsJson.get("defaultValue").getAsString();
                 Boolean fieldVisible = bodyFieldAsJson.get("visible").getAsBoolean();
                 Boolean fieldStatic = bodyFieldAsJson.get("static").getAsBoolean();
-                Field bodyField = new Field(fieldName, fieldValue, fieldVisible, fieldStatic);
-                template.getFields().add(bodyField);
+                TemplateField bodyTemplateField = new TemplateField(fieldName, fieldValue, fieldVisible, fieldStatic);
+                template.getTemplateFields().add(bodyTemplateField);
             }
             generatedTemplates.put(template.getName(), template);
         }
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ParserToJson.java b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterToJson.java
similarity index 88%
rename from src/main/java/org/onap/clamp/clds/tosca/update/ParserToJson.java
rename to src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterToJson.java
index 3c5cf97..297d568 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/ParserToJson.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterToJson.java
@@ -29,12 +29,20 @@
 import java.util.Collection;
 import java.util.LinkedHashMap;
 import java.util.Map.Entry;
+import org.onap.clamp.tosca.DictionaryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
-public class ParserToJson {
-    private LinkedHashMap<String, Component> components;
+@Component
+public class ToscaConverterToJson {
+    private LinkedHashMap<String, ToscaElement> components;
     private LinkedHashMap<String, Template> templates;
 
-    public ParserToJson(LinkedHashMap<String, Component> components, LinkedHashMap<String, Template> templates) {
+    // if this one is set, the dictionary mechanism is enabled
+    @Autowired
+    private DictionaryService dictionaryService;
+
+    public ToscaConverterToJson(LinkedHashMap<String, ToscaElement> components, LinkedHashMap<String, Template> templates) {
         this.components = components;
         this.templates = templates;
     }
@@ -61,28 +69,28 @@
     /**
      * Return the classical/general fields of the component, & launch the properties deployment.
      *
-     * @param component the compo
+     * @param toscaElement the compo
      * @return a json object
      */
-    public JsonObject getFieldAsObject(Component component) {
+    public JsonObject getFieldAsObject(ToscaElement toscaElement) {
 
         JsonObject globalFields = new JsonObject();
         if (templates.get("object").hasFields("title")) {
-            globalFields.addProperty("title", component.getName());
+            globalFields.addProperty("title", toscaElement.getName());
         }
         if (templates.get("object").hasFields("type")) {
             globalFields.addProperty("type", "object");
         }
         if (templates.get("object").hasFields("description")) {
-            if (component.getDescription() != null) {
-                globalFields.addProperty("description", component.getDescription());
+            if (toscaElement.getDescription() != null) {
+                globalFields.addProperty("description", toscaElement.getDescription());
             }
         }
         if (templates.get("object").hasFields("required")) {
-            globalFields.add("required", this.getRequirements(component.getName()));
+            globalFields.add("required", this.getRequirements(toscaElement.getName()));
         }
         if (templates.get("object").hasFields("properties")) {
-            globalFields.add("properties", this.deploy(component.getName()));
+            globalFields.add("properties", this.deploy(toscaElement.getName()));
         }
         return globalFields;
     }
@@ -95,7 +103,7 @@
      */
     public JsonArray getRequirements(String nameComponent) {
         JsonArray requirements = new JsonArray();
-        Component toParse = components.get(nameComponent);
+        ToscaElement toParse = components.get(nameComponent);
         //Check for a father component, and launch the same process
         if (!toParse.getDerivedFrom().equals("tosca.datatypes.Root")
                 && !toParse.getDerivedFrom().equals("tosca.policies.Root")) {
@@ -121,7 +129,7 @@
      */
     public JsonObject deploy(String nameComponent) {
         JsonObject jsonSchema = new JsonObject();
-        Component toParse = components.get(nameComponent);
+        ToscaElement toParse = components.get(nameComponent);
         //Check for a father component, and launch the same process
         if (!toParse.getDerivedFrom().equals("tosca.datatypes.Root")
                 && !toParse.getDerivedFrom().equals("tosca.policies.Root")) {
@@ -212,6 +220,8 @@
                     }
                     break;
                 case "metadata":
+                    propertiesInJson.add("enum", MetadataParser.processAllMetadataElement(property,
+                            dictionaryService));
                     break;
                 case "constraints":
                     property.addConstraintsAsJson(propertiesInJson,
@@ -222,7 +232,7 @@
                     //Here, a way to check if entry is a component (datatype) or a simple string
                     if (matchComponent(this.extractSpecificFieldFromMap(property, "entry_schema")) != null) {
                         String nameComponent = this.extractSpecificFieldFromMap(property, "entry_schema");
-                        ParserToJson child = new ParserToJson(components, templates);
+                        ToscaConverterToJson child = new ToscaConverterToJson(components, templates);
                         JsonObject propertiesContainer = new JsonObject();
 
                         switch ((String) property.getItems().get("type")) {
@@ -270,17 +280,17 @@
      * @param name the name
      * @return a component
      */
-    public Component matchComponent(String name) {
-        Component correspondingComponent = null;
+    public ToscaElement matchComponent(String name) {
+        ToscaElement correspondingToscaElement = null;
         if (components == null) {
             return null;
         }
-        for (Component component : components.values()) {
-            if (component.getName().equals(name)) {
-                correspondingComponent = component;
+        for (ToscaElement toscaElement : components.values()) {
+            if (toscaElement.getName().equals(name)) {
+                correspondingToscaElement = toscaElement;
             }
         }
-        return correspondingComponent;
+        return correspondingToscaElement;
     }
 
     /**
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Component.java b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaElement.java
similarity index 95%
rename from src/main/java/org/onap/clamp/clds/tosca/update/Component.java
rename to src/main/java/org/onap/clamp/clds/tosca/update/ToscaElement.java
index 6db129d..d702cda 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/Component.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaElement.java
@@ -26,7 +26,7 @@
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 
-public class Component {
+public class ToscaElement {
 
     /**
      * name parameter is used as "key", in the LinkedHashMap of Components.
@@ -38,7 +38,7 @@
     private String description;
     private LinkedHashMap<String, Property> properties;
 
-    public Component() {
+    public ToscaElement() {
     }
 
     /**
@@ -49,7 +49,7 @@
      * @param description description
      */
     @SuppressWarnings({"unchecked", "rawtypes"})
-    public Component(String name, String derivedFrom, String description) {
+    public ToscaElement(String name, String derivedFrom, String description) {
         super();
         this.name = name;
         this.derivedFrom = derivedFrom;
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaItemsParser.java b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaItemsParser.java
new file mode 100644
index 0000000..443a4b0
--- /dev/null
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaItemsParser.java
@@ -0,0 +1,109 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.clamp.clds.tosca.update;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map.Entry;
+import org.yaml.snakeyaml.Yaml;
+
+public class ToscaItemsParser {
+    private LinkedHashMap<String, ToscaElement> allItemsFound;
+
+    /**
+     * Constructor.
+     *
+     * @param toscaYaml               The tosca to parse
+     * @param toscaNativeDataTypeYaml THe name of the policy type to search
+     */
+    public ToscaItemsParser(String toscaYaml, String toscaNativeDataTypeYaml) {
+        this.allItemsFound = searchAllToscaElements(toscaYaml, toscaNativeDataTypeYaml);
+    }
+
+    public LinkedHashMap<String, ToscaElement> getAllItemsFound() {
+        return allItemsFound;
+    }
+
+    private static LinkedHashMap<String, Object> searchAllDataTypesAndPolicyTypes(String toscaYaml) {
+        LinkedHashMap<String, LinkedHashMap<String, Object>> file =
+                (LinkedHashMap<String, LinkedHashMap<String, Object>>) new Yaml().load(toscaYaml);
+        // Get DataTypes
+        LinkedHashMap<String, Object> allItemsFound = file.get("data_types");
+        allItemsFound = (allItemsFound == null) ? (new LinkedHashMap<>()) : allItemsFound;
+        // Put the policies and datatypes in the same collection
+        allItemsFound.putAll(file.get("policy_types"));
+        return allItemsFound;
+    }
+
+    private static LinkedHashMap<String, Object> searchAllNativeToscaDataTypes(String toscaNativeYaml) {
+        return ((LinkedHashMap<String, LinkedHashMap<String, Object>>) new Yaml().load(toscaNativeYaml))
+                .get("data_types");
+    }
+
+    /**
+     * Yaml Parse gets raw policies and datatypes, in different sections : necessary to extract
+     * all entities and put them at the same level.
+     *
+     * @return a map
+     */
+    private static LinkedHashMap<String, ToscaElement> searchAllToscaElements(String toscaYaml,
+                                                                              String nativeToscaYaml) {
+        LinkedHashMap<String, Object> allItemsFound = searchAllDataTypesAndPolicyTypes(toscaYaml);
+        allItemsFound.putAll(searchAllNativeToscaDataTypes(nativeToscaYaml));
+        return parseAllItemsFound(allItemsFound);
+    }
+
+    /**
+     * With all the component, get as Map, Components and Components properties are created.
+     *
+     * @param allMaps maps
+     */
+    private static LinkedHashMap<String, ToscaElement> parseAllItemsFound(LinkedHashMap<String, Object> allMaps) {
+        LinkedHashMap<String, ToscaElement> allItemsFound = new LinkedHashMap<String, ToscaElement>();
+        //Component creations, from the file maps
+        for (Entry<String, Object> itemToParse : allMaps.entrySet()) {
+            LinkedHashMap<String, Object> componentBody = (LinkedHashMap<String, Object>) itemToParse.getValue();
+            ToscaElement toscaElement =
+                    new ToscaElement(itemToParse.getKey(), (String) componentBody.get("derived_from"),
+                            (String) componentBody.get("description"));
+            //If policy, version and type_version :
+            if (componentBody.get("type_version") != null) {
+                toscaElement.setVersion((String) componentBody.get("type_version"));
+                toscaElement.setTypeVersion((String) componentBody.get("type_version"));
+            }
+            //Properties creation, from the map
+            if (componentBody.get("properties") != null) {
+                LinkedHashMap<String, Object> properties =
+                        (LinkedHashMap<String, Object>) componentBody.get("properties");
+                for (Entry<String, Object> itemToProperty : properties.entrySet()) {
+                    Property property = new Property(itemToProperty.getKey(),
+                            (LinkedHashMap<String, Object>) itemToProperty.getValue());
+                    toscaElement.addProperties(property);
+                }
+            }
+            allItemsFound.put(toscaElement.getName(), toscaElement);
+        }
+        return allItemsFound;
+    }
+}
diff --git a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java b/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java
index 889125f..b7ed1de 100644
--- a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java
+++ b/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java
@@ -54,7 +54,7 @@
     private static final EELFLogger logger = EELFManager.getInstance().getLogger(CsarServiceInstaller.class);
 
     @Autowired
-    ServiceRepository serviceRepository;
+    ServicesRepository serviceRepository;
 
     @Autowired
     CdsServices cdsServices;
diff --git a/src/main/java/org/onap/clamp/loop/service/ServiceRepository.java b/src/main/java/org/onap/clamp/loop/service/ServiceRepository.java
deleted file mode 100644
index a6c5ff1..0000000
--- a/src/main/java/org/onap/clamp/loop/service/ServiceRepository.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights
- *                             reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END============================================
- * ===================================================================
- *
- */
-
-package org.onap.clamp.loop.service;
-
-import org.springframework.data.repository.CrudRepository;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface ServiceRepository extends CrudRepository<Service, String> {
-
-}
diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/clamp/policy/Policy.java
index d52e418..c9055bf 100644
--- a/src/main/java/org/onap/clamp/policy/Policy.java
+++ b/src/main/java/org/onap/clamp/policy/Policy.java
@@ -44,7 +44,7 @@
 import org.hibernate.annotations.TypeDef;
 import org.hibernate.annotations.TypeDefs;
 import org.json.JSONObject;
-import org.onap.clamp.clds.tosca.update.TemplateManagement;
+import org.onap.clamp.clds.tosca.update.ToscaConverterManager;
 import org.onap.clamp.clds.tosca.update.UnknownComponentException;
 import org.onap.clamp.clds.util.ResourceFileUtil;
 import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
@@ -300,9 +300,9 @@
     public static JsonObject generateJsonRepresentationFromToscaModel(String policyToscaModel,
                                                                       String policyModelType)
             throws IOException, UnknownComponentException {
-        return new TemplateManagement(policyToscaModel,ResourceFileUtil.getResourceAsString(
-                "clds/tosca_update/defaultToscaTypes.yaml"),
+        return new ToscaConverterManager(policyToscaModel,ResourceFileUtil.getResourceAsString(
+                "clds/tosca_update/default-tosca-types.yaml"),
                 ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json"))
-                .launchTranslation(policyModelType);
+                .startConversionToJson(policyModelType);
     }
 }
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java
index 357a96d..ad6cbd9 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java
@@ -23,11 +23,11 @@
 
 package org.onap.clamp.policy.operational;
 
-import com.google.gson.JsonObject;
 import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
 import org.onap.clamp.loop.Loop;
+import org.onap.clamp.loop.template.PolicyModelsRepository;
 import org.onap.clamp.policy.PolicyService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -37,9 +37,13 @@
 
     private final OperationalPolicyRepository operationalPolicyRepository;
 
+    private final PolicyModelsRepository policyModelsRepository;
+
     @Autowired
-    public OperationalPolicyService(OperationalPolicyRepository repository) {
+    public OperationalPolicyService(OperationalPolicyRepository repository,
+                                    PolicyModelsRepository policyModelsRepository) {
         this.operationalPolicyRepository = repository;
+        this.policyModelsRepository = policyModelsRepository;
     }
 
     @Override
@@ -49,10 +53,8 @@
                 .map(policy ->
                         operationalPolicyRepository
                                 .findById(policy.getName())
-                                .map(p -> setConfigurationJson(p, policy))
-                                .orElse(new OperationalPolicy(policy.getName(), loop,
-                                        policy.getConfigurationsJson(),
-                                        policy.getPolicyModel(), null, policy.getPdpGroup(), policy.getPdpSubgroup())))
+                                .map(p -> setConfiguration(p, policy))
+                                .orElse(initializeMissingFields(loop,policy)))
                 .collect(Collectors.toSet());
     }
 
@@ -61,7 +63,12 @@
         return operationalPolicyRepository.existsById(policyName);
     }
 
-    private OperationalPolicy setConfigurationJson(OperationalPolicy policy, OperationalPolicy newPolicy) {
+    private OperationalPolicy initializeMissingFields(Loop loop, OperationalPolicy policy) {
+        policy.setLoop(loop);
+        return policy;
+    }
+
+    private OperationalPolicy setConfiguration(OperationalPolicy policy, OperationalPolicy newPolicy) {
         policy.setConfigurationsJson(newPolicy.getConfigurationsJson());
         policy.setPdpGroup(newPolicy.getPdpGroup());
         policy.setPdpSubgroup(newPolicy.getPdpSubgroup());
diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html
index 69e9c7c..29082ab 100644
--- a/src/main/resources/META-INF/resources/swagger.html
+++ b/src/main/resources/META-INF/resources/swagger.html
@@ -692,7 +692,7 @@
 <div class="sect2">
 <h3 id="_uri_scheme"><a class="anchor" href="#_uri_scheme"></a><a class="link" href="#_uri_scheme">1.2. URI scheme</a></h3>
 <div class="paragraph">
-<p><em>Host</em> : localhost:39237<br>
+<p><em>Host</em> : localhost:46347<br>
 <em>BasePath</em> : /restservices/clds/<br>
 <em>Schemes</em> : HTTP</p>
 </div>
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties
index 288511b..3ce033f 100644
--- a/src/main/resources/application-noaaf.properties
+++ b/src/main/resources/application-noaaf.properties
@@ -176,4 +176,9 @@
 clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal
 
 ## Tosca converter
-clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.json
\ No newline at end of file
+clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.json
+
+# Configuration settings for CDS
+clamp.config.cds.url=http4://blueprints-processor-http:8080
+clamp.config.cds.userName=ccsdkapps
+clamp.config.cds.password=ccsdkapps
\ No newline at end of file
diff --git a/src/main/resources/clds/tosca_update/defaultToscaTypes.yaml b/src/main/resources/clds/tosca_update/default-tosca-types.yaml
similarity index 100%
rename from src/main/resources/clds/tosca_update/defaultToscaTypes.yaml
rename to src/main/resources/clds/tosca_update/default-tosca-types.yaml
diff --git a/src/main/resources/clds/tosca_update/templates.properties b/src/main/resources/clds/tosca_update/templates.properties
deleted file mode 100644
index 5da239b..0000000
--- a/src/main/resources/clds/tosca_update/templates.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-#Numeric types
-integer=type,description,title,deprecated,default,enum,const,multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum
-number=type,description,title,deprecated,default,enum,const,multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum
-range=type,description,title,deprecated,default,enum,const,multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum
-#
-boolean=type,description,title,deprecated,default,enum,const,readOnly,writeOnly
-#String types
-string=type,description,title,deprecated,default,enum,const,minLength,maxLength,pattern,format
-timestamp=type,description,title,deprecated,default,enum,const,minLength,maxLength,pattern,format
-scalar-unit.time=type,description,title,deprecated,default,enum,const,minLength,maxLength,pattern,format
-scalar-unit.frequency=type,description,title,deprecated,default,enum,const,minLength,maxLength,pattern,format
-scalar-unit.size=type,description,title,deprecated,default,enum,const,minLength,maxLength,pattern,format
-#Complex types
-array=type,description,title,deprecated,default,enum,const,minItems,maxItems,uniqueItems,minContains,maxContains
-object=type,description,title,deprecated,default,enum,const,properties,minProperties,maxProperties,required,dependentRequired,dependencies,readOnly,writeOnly
