diff --git a/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java b/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java
index 7abb692..a74f4c7 100644
--- a/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java
+++ b/src/main/java/org/onap/clamp/clds/camel/CamelProxy.java
@@ -59,7 +59,7 @@
      *            The latest event action in database (like CREATE, SUBMIT, ...)
      * @return A string containing the result of the Camel flow execution
      */
-    String submit(@ExchangeProperty("actionCd") String actionCommand,
+    String executeAction(@ExchangeProperty("actionCd") String actionCommand,
             @ExchangeProperty("modelProp") String modelProperties,
             @ExchangeProperty("modelBpmnProp") String modelBpmnProperties,
             @ExchangeProperty("modelName") String modelName, @ExchangeProperty("controlName") String controlName,
diff --git a/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java b/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java
index b1243dc..8dfa190 100644
--- a/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * 
+ *
  */
 
 package org.onap.clamp.clds.client;
@@ -48,22 +48,24 @@
      * Insert event using process variables.
      *
      * @param camelExchange
-     *            The Camel Exchange object containing the properties
+     *        The Camel Exchange object containing the properties
      */
     @Handler
     public void execute(Exchange camelExchange) {
         String controlName = (String) camelExchange.getProperty("controlName");
         String actionCd = (String) camelExchange.getProperty("actionCd");
-        String actionStateCd = (String) camelExchange.getProperty("actionStateCd");
-        // Flag indicate whether it is triggered by Validation Test button from
-        // UI
-        boolean isTest = (boolean) camelExchange.getProperty("isTest");
-        boolean isInsertTestEvent = (boolean) camelExchange.getProperty("isInsertTestEvent");
-        String userid = (String) camelExchange.getProperty("userid");
-        // do not insert events for test actions unless flag set to insert them
-        if (!isTest || isInsertTestEvent) {
-            // won't really have userid here...
-            CldsEvent.insEvent(cldsDao, controlName, userid, actionCd, actionStateCd, camelExchange.getExchangeId());
-        }
+        String actionStateCd = ((String) camelExchange.getProperty("actionStateCd")) != null
+            ? ((String) camelExchange.getProperty("actionStateCd"))
+                : CldsEvent.ACTION_STATE_COMPLETED;
+            // Flag indicate whether it is triggered by Validation Test button from
+            // UI
+            boolean isTest = (boolean) camelExchange.getProperty("isTest");
+            boolean isInsertTestEvent = (boolean) camelExchange.getProperty("isInsertTestEvent");
+            String userid = (String) camelExchange.getProperty("userid");
+            // do not insert events for test actions unless flag set to insert them
+            if (!isTest || isInsertTestEvent) {
+                // won't really have userid here...
+                CldsEvent.insEvent(cldsDao, controlName, userid, actionCd, actionStateCd, camelExchange.getExchangeId());
+            }
     }
 }
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java
index 5e35b89..8d497cb 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java
@@ -363,8 +363,7 @@
             logger.info("PUT deploymentId={}", model.getDeploymentId());
             this.fillInCldsModel(model);
             // save model to db
-            model.setName(modelName);
-            updateAndInsertNewEvent(modelName, model.getControlNamePrefix(), model.getEvent(), CldsEvent.ACTION_SUBMIT);
+            updateAndInsertNewEvent(modelName, model.getControlNamePrefix(), model.getEvent(), CldsEvent.ACTION_MODIFY);
             model.save(cldsDao, getUserId());
             // get vars and format if necessary
             String prop = model.getPropText();
@@ -373,73 +372,56 @@
             String controlName = model.getControlName();
             String bpmnJson = cldsBpmnTransformer.doXslTransformToString(bpmn);
             logger.info("PUT bpmnJson={}", bpmnJson);
-            // Flag indicates whether it is triggered by Validation Test button
-            // from
-            // UI
-            boolean isTest = Boolean.parseBoolean(test);
-            if (!isTest) {
-                String actionTestOverride = refProp.getStringValue("action.test.override");
-                if (Boolean.parseBoolean(actionTestOverride)) {
-                    logger.info("PUT actionTestOverride={}", actionTestOverride);
-                    logger.info("PUT override test indicator and setting it to true");
-                    isTest = true;
-                }
-            }
+            // Test flag coming from UI or from Clamp config
+            boolean isTest = Boolean.parseBoolean(test)
+                || Boolean.parseBoolean(refProp.getStringValue("action.test.override"));
             logger.info("PUT isTest={}", isTest);
-            String insertTestEvent = refProp.getStringValue("action.insert.test.event");
-            boolean isInsertTestEvent = Boolean.parseBoolean(insertTestEvent);
-
+            boolean isInsertTestEvent = Boolean.parseBoolean(refProp.getStringValue("action.insert.test.event"));
             logger.info("PUT isInsertTestEvent={}", isInsertTestEvent);
             // determine if requested action is permitted
             model.validateAction(actionCd);
             logger.info("modelProp - " + prop);
             logger.info("docText - " + docText);
             try {
-                String result = camelProxy.submit(actionCd, prop, bpmnJson, modelName, controlName, docText, isTest,
-                    userId, isInsertTestEvent, model.getEvent().getActionCd());
+                String result = camelProxy.executeAction(actionCd, prop, bpmnJson, modelName, controlName, docText,
+                    isTest, userId, isInsertTestEvent, model.getEvent().getActionCd());
                 logger.info("Starting Camel flow on request, result is: ", result);
             } catch (SdcCommunicationException | PolicyClientException | BadRequestException e) {
                 errorCase = true;
                 logger.error("Exception occured during invoking Camel process", e);
             }
-            if (!actionCd.equalsIgnoreCase(CldsEvent.ACTION_DELETE)) {
-                // refresh model info from db (get fresh event info)
+            if (actionCd.equalsIgnoreCase(CldsEvent.ACTION_DELETE)) {
+                util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO,
+                    ONAPLogConstants.ResponseStatus.COMPLETED);
+                return new ResponseEntity<>("", HttpStatus.OK);
+            } else {
                 retrievedModel = CldsModel.retrieve(cldsDao, modelName, false);
             }
-            if (retrievedModel != null) {
-                if (!isTest && !errorCase
-                    && (actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMIT)
-                        || actionCd.equalsIgnoreCase(CldsEvent.ACTION_RESUBMIT)
-                        || actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMITDCAE))) {
-                    if (retrievedModel.getTemplateName().startsWith(CsarInstallerImpl.TEMPLATE_NAME_PREFIX)) {
-                        // SDC artifact case
-                        logger
-                        .info("Skipping DCAE inventory call as closed loop has been created from SDC notification");
-                        DcaeEvent dcaeEvent = new DcaeEvent();
-                        dcaeEvent.setArtifactName(retrievedModel.getControlName() + ".yml");
-                        dcaeEvent.setEvent(DcaeEvent.EVENT_DISTRIBUTION);
-                        CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), userId, dcaeEvent.getCldsActionCd(),
-                            CldsEvent.ACTION_STATE_RECEIVED, null);
-                    } else {
-                        // This should be done only when the call to DCAE
-                        // has not yet been done. When CL comes from SDC
-                        // this is not required as the DCAE inventory call is done
-                        // during the CL deployment.
-                        dcaeInventoryServices.setEventInventory(retrievedModel, getUserId());
-                    }
-                    retrievedModel.save(cldsDao, getUserId());
+            if (!isTest && !errorCase
+                && (actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMIT)
+                    || actionCd.equalsIgnoreCase(CldsEvent.ACTION_RESUBMIT)
+                    || actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMITDCAE))) {
+                if (retrievedModel.getTemplateName().startsWith(CsarInstallerImpl.TEMPLATE_NAME_PREFIX)) {
+                    // SDC artifact case
+                    logger.info("Skipping DCAE inventory call as closed loop has been created from SDC notification");
+                    DcaeEvent dcaeEvent = new DcaeEvent();
+                    dcaeEvent.setArtifactName(retrievedModel.getControlName() + ".yml");
+                    dcaeEvent.setEvent(DcaeEvent.EVENT_DISTRIBUTION);
+                    CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), userId, dcaeEvent.getCldsActionCd(),
+                        CldsEvent.ACTION_STATE_RECEIVED, null);
+                } else {
+                    // This should be done only when the call to DCAE
+                    // has not yet been done. When CL comes from SDC
+                    // this is not required as the DCAE inventory call is done
+                    // during the CL deployment.
+                    dcaeInventoryServices.setEventInventory(retrievedModel, getUserId());
                 }
-                // audit log
-                LoggingUtils.setTimeContext(startTime, new Date());
-                auditLogger.info("Process model action completed");
-            } else {
-                logger.error("CldsModel not found in database with modelName: " + modelName);
-                util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(),
-                    "CldsModel not found in database with modelName " + "modelName", Level.INFO,
-                    ONAPLogConstants.ResponseStatus.ERROR);
-                return new ResponseEntity<String>("CldsModel not found in database with modelName: \" + modelName",
-                    HttpStatus.INTERNAL_SERVER_ERROR);
+                retrievedModel.save(cldsDao, getUserId());
             }
+            // audit log
+            LoggingUtils.setTimeContext(startTime, new Date());
+            auditLogger.info("Process model action completed");
+
         } catch (Exception e) {
             errorCase = true;
             logger.error("Exception occured during putModelAndProcessAction", e);
diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js
index 0c39952..d01016a 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/app.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/app.js
@@ -259,8 +259,8 @@
 				$scope.cldsConfirmPerformAction("RESUBMIT");
 			} else if (name == "Update") {
 				$scope.cldsConfirmPerformAction("UPDATE");
-			} else if (name.toLowerCase() == "delete") {
-				$scope.manageConfirmPerformAction("DELETE");
+			} else if (name == "Delete") {
+				$scope.cldsConfirmPerformAction("DELETE");
 			} else if (name == "Stop") {
 				$scope.cldsConfirmPerformAction("STOP");
 			} else if (name == "Restart") {
@@ -670,23 +670,7 @@
 		}, function(data) {
 		});
 	}
-	$scope.managePerformAction = function(action) {
-		if (action.toLowerCase() === "delete") {
-			cldsModelService.manageAction(selected_model,
-			"805b9f83-261f-48d9-98c7-8011fc2cc8e8", "ClosedLoop-ABCD-0000.yml")
-			.then(function(pars) {
-			}, function(data) {
-			});
-		}
-	};
-	$scope.manageConfirmPerformAction = function(uiAction) {
-		var dlg = dialogs.confirm('Message', 'Do you want to '
-		+ uiAction.toLowerCase() + ' the closed loop?');
-		dlg.result.then(function(btn) {
-			$scope.managePerformAction(uiAction);
-		}, function(btn) {
-		});
-	};
+
 	$scope.VesCollectorWindow = function(vesCollector) {
 		var dlg = dialogs.create(
 		'partials/portfolios/vesCollector_properties.html', 'ImportSchemaCtrl',
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index c7f7ec3..e84c686 100644
--- a/src/main/resources/clds/camel/routes/flexible-flow.xml
+++ b/src/main/resources/clds/camel/routes/flexible-flow.xml
@@ -17,13 +17,14 @@
 								<simple> ${exchangeProperty.actionCd} == 'DELETE'</simple>
 								<to uri="bean:org.onap.clamp.clds.client.TcaPolicyDeleteDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDeleteDelegate" />
-								<to uri="bean:org.onap.clamp.clds.client.ModelDeleteDelegate" />
 								<delay>
 										<constant>30000</constant>
 								</delay>
 								<to
 										uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.ModelDeleteDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'UPDATE'</simple>
