diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
index fdc51ff..d162ccd 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
@@ -140,7 +140,7 @@
 
         instanceIdMap.put("serviceId", serviceId);
 
-        return updateE2EserviceInstances(request, Action.updateInstance, instanceIdMap, version);
+        return updateE2EserviceInstances(request, Action.updateInstance, version);
     }
 
     /**
@@ -188,7 +188,7 @@
 
         logger.debug("------------------scale begin------------------");
         instanceIdMap.put("serviceId", serviceId);
-        return scaleE2EserviceInstances(request, Action.scaleInstance, instanceIdMap, version);
+        return scaleE2EserviceInstances(request, Action.scaleInstance, version);
     }
 
     /**
@@ -251,8 +251,6 @@
         RequestClient requestClient;
         HttpResponse response;
 
-        long subStartTime = System.currentTimeMillis();
-
         try {
             requestClient = requestClientFactory.getRequestClient(workflowUrl);
 
@@ -291,8 +289,7 @@
         ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
         int bpelStatus = respHandler.getStatus();
 
-        return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
-                version);
+        return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
     }
 
     private Response getE2EServiceInstance(String serviceId, String operationId, String version) {
@@ -301,8 +298,6 @@
 
         String apiVersion = version.substring(1);
 
-        long startTime = System.currentTimeMillis();
-
         OperationStatus operationStatus;
 
         try {
@@ -392,7 +387,6 @@
         RequestClient requestClient;
         HttpResponse response;
 
-        long subStartTime = System.currentTimeMillis();
         try {
             requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
 
@@ -436,12 +430,10 @@
         ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
         int bpelStatus = respHandler.getStatus();
 
-        return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
-                version);
+        return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
     }
 
-    private Response updateE2EserviceInstances(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
-            String version) throws ApiException {
+    private Response updateE2EserviceInstances(String requestJSON, Action action, String version) throws ApiException {
 
         String requestId = UUID.randomUUID().toString();
         long startTime = System.currentTimeMillis();
@@ -513,7 +505,6 @@
         RequestClient requestClient;
         HttpResponse response;
 
-        long subStartTime = System.currentTimeMillis();
         String sirRequestJson = convertToString(sir);
 
         try {
@@ -554,8 +545,7 @@
         ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
         int bpelStatus = respHandler.getStatus();
 
-        return beplStatusUpdate(serviceId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
-                version);
+        return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
     }
 
     private Response processE2EserviceInstances(String requestJSON, Action action,
@@ -629,7 +619,6 @@
         RequestClient requestClient;
         HttpResponse response;
 
-        long subStartTime = System.currentTimeMillis();
         String sirRequestJson = convertToString(sir);
 
         try {
@@ -668,12 +657,10 @@
         ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
         int bpelStatus = respHandler.getStatus();
 
-        return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
-                version);
+        return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
     }
 
-    private Response scaleE2EserviceInstances(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
-            String version) throws ApiException {
+    private Response scaleE2EserviceInstances(String requestJSON, Action action, String version) throws ApiException {
 
         String requestId = UUID.randomUUID().toString();
         long startTime = System.currentTimeMillis();
@@ -728,7 +715,6 @@
         RequestClient requestClient;
         HttpResponse response;
 
-        long subStartTime = System.currentTimeMillis();
         try {
             requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
 
@@ -772,12 +758,10 @@
         ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
         int bpelStatus = respHandler.getStatus();
 
-        return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
-                version);
+        return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
     }
 
-    private Response beplStatusUpdate(String serviceId, long startTime, RequestClient requestClient,
-            ResponseHandler respHandler, int bpelStatus, Action action, HashMap<String, String> instanceIdMap,
+    private Response beplStatusUpdate(RequestClient requestClient, ResponseHandler respHandler, int bpelStatus,
             String version) {
 
         String apiVersion = version.substring(1);
@@ -876,7 +860,6 @@
 
         ServiceInstancesRequest sir = new ServiceInstancesRequest();
 
-        String returnString = null;
         RequestDetails requestDetails = new RequestDetails();
         ModelInfo modelInfo = new ModelInfo();
 
