diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/HealthCheckHandler.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/HealthCheckHandler.java
index 85bca6f..5314de0 100644
--- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/HealthCheckHandler.java
+++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/HealthCheckHandler.java
@@ -48,7 +48,7 @@
 			MsoLogger.setServiceName ("Healthcheck");
 			UUIDChecker.verifyOldUUID(requestId, msoLogger);
 			HealthCheckUtils healthCheck = new HealthCheckUtils ();
-			if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+			if (!healthCheck.siteStatusCheck(msoLogger)) {
 				return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 			}
 
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java
index 0c4c1c4..2a74d79 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java
@@ -46,7 +46,7 @@
 			MsoLogger.setServiceName ("Healthcheck");
 			UUIDChecker.verifyOldUUID(requestId, msoLogger);
 			HealthCheckUtils healthCheck = new HealthCheckUtils ();
-			if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+			if (!healthCheck.siteStatusCheck(msoLogger)) {
 				return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 			}
 
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java
index c69aee5..f6a3e36 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java
@@ -131,7 +131,7 @@
 		MsoLogger.setServiceName ("Healthcheck");
 		UUIDChecker.verifyOldUUID(requestId, msoLogger);
 		HealthCheckUtils healthCheck = new HealthCheckUtils ();
-		if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+		if (!healthCheck.siteStatusCheck(msoLogger)) {
 			return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 		}
 
@@ -152,7 +152,7 @@
 		// Generate a Request Id
 		String requestId = UUIDChecker.generateUUID(msoLogger);
 		HealthCheckUtils healthCheck = new HealthCheckUtils ();
-		if (!healthCheck.siteStatusCheck (msoLogger, startTime)) {
+		if (!healthCheck.siteStatusCheck (msoLogger)) {
 			return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 		}
 
@@ -175,7 +175,7 @@
 		// Generate a Request Id
 		String requestId = UUIDChecker.generateUUID(msoLogger);
 		HealthCheckUtils healthCheck = new HealthCheckUtils ();
-		if (!healthCheck.siteStatusCheck (msoLogger, startTime)) {
+		if (!healthCheck.siteStatusCheck (msoLogger)) {
 			return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 		}
 
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCAdapterRest.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCAdapterRest.java
index 0c787ca..f7a37fc 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCAdapterRest.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCAdapterRest.java
@@ -58,7 +58,7 @@
 		UUIDChecker.verifyOldUUID(requestId, LOGGER);
 		HealthCheckUtils healthCheck = new HealthCheckUtils();
 
-		if (!healthCheck.siteStatusCheck(LOGGER, startTime)) {
+		if (!healthCheck.siteStatusCheck(LOGGER)) {
 			return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 		}
 
diff --git a/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/HealthCheckHandler.java b/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/HealthCheckHandler.java
index ce2113e..1a4bec4 100644
--- a/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/HealthCheckHandler.java
+++ b/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/HealthCheckHandler.java
@@ -45,7 +45,7 @@
 			MsoLogger.setServiceName ("Healthcheck");
 			UUIDChecker.verifyOldUUID(requestId, msoLogger);
 			HealthCheckUtils healthCheck = new HealthCheckUtils ();
-			if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+			if (!healthCheck.siteStatusCheck(msoLogger)) {
 				return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 			}
 
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/HealthCheckHandler.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/HealthCheckHandler.java
index 13e963f..8e163d4 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/HealthCheckHandler.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/HealthCheckHandler.java
@@ -56,7 +56,7 @@
         MsoLogger.setServiceName("Healthcheck");
         UUIDChecker.verifyOldUUID(requestId, msoLogger);
         HealthCheckUtils healthCheck = new HealthCheckUtils();
-        if(!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+        if(!healthCheck.siteStatusCheck(msoLogger)) {
             return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
         }
 
diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/HealthCheckHandler.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/HealthCheckHandler.java
index 3b619d9..840bd02 100644
--- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/HealthCheckHandler.java
+++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/HealthCheckHandler.java
@@ -49,7 +49,7 @@
 		MsoLogger.setServiceName ("Healthcheck");
 		UUIDChecker.verifyOldUUID(requestId, msoLogger);
 		HealthCheckUtils healthCheck = new HealthCheckUtils ();
-		if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+		if (!healthCheck.siteStatusCheck(msoLogger)) {
 			return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 		}
 
diff --git a/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/WMAdapterRest.java b/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/WMAdapterRest.java
index dc94a78..4be6b93 100644
--- a/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/WMAdapterRest.java
+++ b/adapters/mso-workflow-message-adapter/src/main/java/org/openecomp/mso/adapters/workflowmessage/WMAdapterRest.java
@@ -30,8 +30,6 @@
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
@@ -62,7 +60,7 @@
 		UUIDChecker.verifyOldUUID(requestId, LOGGER);
 		HealthCheckUtils healthCheck = new HealthCheckUtils();
 
-		if (!healthCheck.siteStatusCheck(LOGGER, startTime)) {
+		if (!healthCheck.siteStatusCheck(LOGGER)) {
 			return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 		}
 
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/healthcheck/HealthCheckHandler.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/healthcheck/HealthCheckHandler.java
index 24e1153..2162607 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/healthcheck/HealthCheckHandler.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/healthcheck/HealthCheckHandler.java
@@ -59,7 +59,7 @@
 			MsoLogger.setServiceName ("Healthcheck");
 			UUIDChecker.verifyOldUUID(requestId, msoLogger);
 			HealthCheckUtils healthCheck = new HealthCheckUtils ();
-			if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+			if (!healthCheck.siteStatusCheck(msoLogger)) {
 				return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
 			}
 
diff --git a/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java b/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java
index 3675dd6..f0ca191 100644
--- a/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java
+++ b/common/src/main/java/org/openecomp/mso/properties/MsoJavaProperties.java
@@ -115,7 +115,6 @@
 
 		} finally {
 			this.automaticRefreshInMinutes = this.getIntProperty(RELOAD_TIME_PROPERTY, DEFAULT_RELOAD_TIME_MIN);
-			// Always close the file
 			try {
 				if (reader != null) {
 					reader.close();
@@ -155,27 +154,31 @@
 			return false;
 		}
 		MsoJavaProperties other = (MsoJavaProperties) obj;
-		if (!msoProperties.equals(other.msoProperties)) {
-			return false;
-		}
-		return true;
+
+		return msoProperties.equals(other.msoProperties);
 	}
 
 	@Override
 	public String toString() {
 
-		StringBuffer response = new StringBuffer();
-		response.append("Config file " + propertiesFileName + "(Timer:" + automaticRefreshInMinutes + "mins):"
-				+ System.getProperty("line.separator"));
+		StringBuilder response = new StringBuilder();
+		response.append("Config file ")
+				.append(propertiesFileName)
+				.append("(Timer:")
+				.append(automaticRefreshInMinutes)
+				.append("mins):")
+				.append(System.lineSeparator());
+
 		for (Object key : this.msoProperties.keySet()) {
 			String propertyName = (String) key;
 			response.append(propertyName);
 			response.append("=");
 			response.append(this.msoProperties.getProperty(propertyName));
-			response.append(System.getProperty("line.separator"));
+			response.append(System.lineSeparator());
 		}
-		response.append(System.getProperty("line.separator"));
-		response.append(System.getProperty("line.separator"));
+		response.append(System.lineSeparator());
+		response.append(System.lineSeparator());
+
 		return response.toString();
 	}
 }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/GlobalHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/GlobalHealthcheckHandler.java
index af0fabc..52256d9 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/GlobalHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/GlobalHealthcheckHandler.java
@@ -53,7 +53,7 @@
         // Generate a Request Id
         String requestId = UUIDChecker.generateUUID(msoLogger);
         HealthCheckUtils healthCheck = new HealthCheckUtils ();
-        if (!healthCheck.siteStatusCheck (msoLogger, startTime)) {
+        if (!healthCheck.siteStatusCheck (msoLogger)) {
             return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
         }
 
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/HealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/HealthcheckHandler.java
index 291414b..55f44a7 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/HealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/HealthcheckHandler.java
@@ -51,7 +51,7 @@
         MsoLogger.setServiceName ("Healthcheck");
         UUIDChecker.verifyOldUUID(requestId, msoLogger);
         HealthCheckUtils healthCheck = new HealthCheckUtils ();
-        if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+        if (!healthCheck.siteStatusCheck(msoLogger)) {
             return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
         }
 
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NodeHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NodeHealthcheckHandler.java
index beb26af..0191b54 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NodeHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NodeHealthcheckHandler.java
@@ -51,7 +51,7 @@
         // Generate a Request Id
         String requestId = UUIDChecker.generateUUID(msoLogger);
         HealthCheckUtils healthCheck = new HealthCheckUtils ();
-        if (!healthCheck.siteStatusCheck (msoLogger, startTime)) {
+        if (!healthCheck.siteStatusCheck (msoLogger)) {
             return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
         }
 
diff --git a/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java b/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
index e7c4e0d..b64f5bf 100644
--- a/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
+++ b/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
@@ -55,7 +55,7 @@
             .entity (NOT_FOUND)
             .build ();
 
-    public enum NodeType {APIH, RA, BPMN};
+    public enum NodeType {APIH, RA, BPMN}
 
     public boolean catalogDBCheck (MsoLogger subMsoLogger, long startTime) {
         try(CatalogDatabase catalogDB = CatalogDatabase.getInstance()) {
@@ -79,7 +79,7 @@
         return true;
     }
 
-    public boolean siteStatusCheck (MsoLogger subMsoLogger, long startTime) {
+    public boolean siteStatusCheck(MsoLogger subMsoLogger) {
         // Check the Site Status value in DB first, if set to false, return NOK
         String site = getProperty("site-name");
 
@@ -180,57 +180,26 @@
         if (null == topologyProp) {
             return false;
         }
-        String port = topologyProp.getProperty("server-port", null);
-        String ip = System.getProperty("jboss.qualified.host.name");
-        String sslEnabled = topologyProp.getProperty("ssl-enable", null);
 
-        if (null == port || null == ip || ip.isEmpty() || port.isEmpty()) {
-            msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, "Not able to get the IP or the Port value. IP:" + ip + "; Port:" + port, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Not able to get the IP or the Port value. IP:" + ip + "; Port:" + port);
-            return false;
+        checkHealthForProperty(topologyProp, "", requestId);
+
+        boolean healthCheck = false;
+        switch (type) {
+            case APIH:
+                healthCheck = checkHealthForProperty(topologyProp, "apih-healthcheck-urn", requestId);
+                break;
+            case RA:
+                healthCheck = checkHealthForProperty(topologyProp, "jra-healthcheck-urn", requestId);
+                break;
+            case BPMN:
+                healthCheck = checkHealthForProperty(topologyProp, "camunda-healthcheck-urn", requestId);
+                break;
+            default:
+                msoLogger.error(MessageEnum.GENERAL_EXCEPTION_ARG, "Unknown NodeType:" + type, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Unknown NodeType:" + type);
+                break;
         }
 
-        String[] apis;
-        if (NodeType.APIH.equals (type)) {
-            String apiList = topologyProp.getProperty("apih-healthcheck-urn", null);
-            if (null == apiList) {
-                String errorDescription = "Not able to get apih-healthcheck-urn parameter";
-                msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, errorDescription, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, errorDescription);
-                return false;
-            }
-            apis = apiList.split(",");
-        } else if (NodeType.RA.equals (type)){
-            String apiList = topologyProp.getProperty("jra-healthcheck-urn", null);
-            if (null == apiList) {
-                String errorDescription = "Not able to get jra-healthcheck-urn parameter";
-                msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, errorDescription, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, errorDescription);
-                return false;
-            }
-            apis = apiList.split(",");
-        } else if (NodeType.BPMN.equals (type)){
-            String apiList = topologyProp.getProperty("camunda-healthcheck-urn", null);
-            if (null == apiList) {
-                String errorDescription = "Not able to get camunda-healthcheck-urn parameter";
-                msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, errorDescription, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, errorDescription);
-                return false;
-            }
-            apis = apiList.split(",");
-        } else {
-            msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, "Unknown NodeType:" + type, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Unknown NodeType:" + type);
-            return false;
-        }
-
-        // Verify health check on APIH servers
-        for (String url : apis) {
-            // if any of the parameters is null or empty, no need to establish the health check request, just go to the next iteration
-            if ((url == null)  || url.isEmpty()) {
-                continue;
-            }
-            // Exit the loop if local health check returns false from any of the sub component
-            if (!this.verifyLocalHealth(ip, port, url, sslEnabled, requestId)) {
-                return false;
-            }
-        }
-        return true;
+        return healthCheck;
     }
 
     public boolean verifyGlobalHealthCheck(boolean verifyBpmn, String requestId) {
@@ -241,37 +210,9 @@
             return false;
         }
 
-        String apihLB = topologyProp.getProperty("apih-load-balancer", null);
-        String apihApi = topologyProp.getProperty("apih-nodehealthcheck-urn", null);
-        String bpmnLB= topologyProp.getProperty("camunda-load-balancer", null);
-        String bpmnApi = topologyProp.getProperty("camunda-nodehealthcheck-urn", null);
-        String jraLB = topologyProp.getProperty("jra-load-balancer", null);
-        String jraApi = topologyProp.getProperty("jra-nodehealthcheck-urn", null);
-
-        if (null == apihLB || null == apihApi || null == bpmnLB || null == bpmnApi || null == jraLB || null == jraApi
-                || apihLB.isEmpty () || apihApi.isEmpty () || bpmnLB.isEmpty () || bpmnApi.isEmpty () || jraLB.isEmpty () || jraApi.isEmpty () ) {
-            msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, "Key parameters are missing from the topology file", "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Key parameters are missing from the topology file");
-            return false;
-        }
-
-        // Verify health check on APIH servers
-        if (!this.verifyLocalHealth (apihLB, null, apihApi, null, requestId)) {
-            return false;
-        }
-
-        // Verify health check on Camunda servers
-        if (verifyBpmn) {
-            if (!this.verifyLocalHealth (bpmnLB, null, bpmnApi, null, requestId)) {
-                return false;
-            }
-        }
-
-        // Verify health check on RA servers
-        if (!verifyLocalHealth (jraLB, null, jraApi, null, requestId)) {
-            return false;
-        }
-
-        return true;
+        return verifyApihServersHealthCheck(topologyProp, requestId) &&
+                verifyCamundaServersHealthCheck(topologyProp, requestId, verifyBpmn) &&
+                verifyRaServersHealthCheck(topologyProp, requestId);
     }
 
     public String getProperty (String name) {
@@ -283,8 +224,8 @@
     protected String getFinalUrl (String ip, String port, String url, String sslEnabled) {
         if (null == port && null == sslEnabled) {
             int length = ip.length();
-            if (ip.substring(length - 1).equals ("/")) {
-                ip = ip.substring (0, length - 1);
+            if ("/".equals(ip.substring(length - 1))) {
+                ip = ip.substring(0, length - 1);
             }
             return ip + url;
         } else if ("true".equalsIgnoreCase(sslEnabled)) {
@@ -293,4 +234,75 @@
             return "http://" + ip + ":" + port + url;
         }
     }
+
+    private boolean verifyRaServersHealthCheck(MsoJavaProperties topologyProp, String requestId) {
+        String jraLB = topologyProp.getProperty("jra-load-balancer", null);
+        String jraApi = topologyProp.getProperty("jra-nodehealthcheck-urn", null);
+
+        if (null == jraLB || null == jraApi || jraLB.isEmpty() || jraApi.isEmpty()) {
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION_ARG, "Key parameters are missing from the topology file", "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Key parameters are missing from the topology file");
+            return false;
+        }
+
+        return verifyLocalHealth(jraLB, null, jraApi, null, requestId);
+    }
+
+    private boolean verifyCamundaServersHealthCheck(MsoJavaProperties topologyProp, String requestId, boolean verifyBpmn) {
+        String bpmnLB = topologyProp.getProperty("camunda-load-balancer", null);
+        String bpmnApi = topologyProp.getProperty("camunda-nodehealthcheck-urn", null);
+
+        if (null == bpmnLB || null == bpmnApi || bpmnLB.isEmpty() || bpmnApi.isEmpty()) {
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION_ARG, "Key parameters are missing from the topology file", "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Key parameters are missing from the topology file");
+            return false;
+        }
+
+        return !verifyBpmn || verifyLocalHealth(bpmnLB, null, bpmnApi, null, requestId);
+    }
+
+    private boolean verifyApihServersHealthCheck(MsoJavaProperties topologyProp, String requestId) {
+        String apihLB = topologyProp.getProperty("apih-load-balancer", null);
+        String apihApi = topologyProp.getProperty("apih-nodehealthcheck-urn", null);
+
+        if (null == apihLB || null == apihApi || apihLB.isEmpty() || apihApi.isEmpty()) {
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION_ARG, "Key parameters are missing from the topology file", "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Key parameters are missing from the topology file");
+            return false;
+        }
+
+        return verifyLocalHealth(apihLB, null, apihApi, null, requestId);
+    }
+
+    private boolean checkHealthForProperty(MsoJavaProperties topologyProp, String property, String requestId) {
+        String apiList = topologyProp.getProperty(property, null);
+        if (apiList == null) {
+            String errorDescription = "Not able to get " + property + " parameter";
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION_ARG, errorDescription, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, errorDescription);
+            return false;
+        }
+        String[] apis = apiList.split(",");
+        return checkHealthForEachApi(topologyProp, apis, requestId);
+    }
+
+    private boolean checkHealthForEachApi(MsoJavaProperties topologyProp, String[] apis, String requestId) {
+
+        String port = topologyProp.getProperty("server-port", null);
+        String ip = System.getProperty("jboss.qualified.host.name");
+        String sslEnabled = topologyProp.getProperty("ssl-enable", null);
+
+        if (null == port || null == ip || ip.isEmpty() || port.isEmpty()) {
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION_ARG, "Not able to get the IP or the Port value. IP:" + ip + "; Port:" + port, "", HEALTH_CHECK, MsoLogger.ErrorCode.DataError, "Not able to get the IP or the Port value. IP:" + ip + "; Port:" + port);
+            return false;
+        }
+
+        for (String url : apis) {
+            // if any of the parameters is null or empty, no need to establish the health check request, just go to the next iteration
+            if ((url == null) || url.isEmpty()) {
+                continue;
+            }
+            // Exit the loop if local health check returns false from any of the sub component
+            if (!this.verifyLocalHealth(ip, port, url, sslEnabled, requestId)) {
+                return false;
+            }
+        }
+        return true;
+    }
 }
diff --git a/status-control/src/test/java/org/openecomp/mso/HealthCheckUtilsTest.java b/status-control/src/test/java/org/openecomp/mso/HealthCheckUtilsTest.java
index cdb5695..91016d2 100644
--- a/status-control/src/test/java/org/openecomp/mso/HealthCheckUtilsTest.java
+++ b/status-control/src/test/java/org/openecomp/mso/HealthCheckUtilsTest.java
@@ -21,22 +21,16 @@
 package org.openecomp.mso;
 
 
-import org.openecomp.mso.logger.MsoLogger;
-import org.openecomp.mso.properties.MsoJavaProperties;
-import org.openecomp.mso.requestsdb.RequestsDatabase;
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.message.BasicStatusLine;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.mockito.Mockito;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
+import org.openecomp.mso.properties.MsoJavaProperties;
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -63,7 +57,7 @@
     private static CloseableHttpResponse nokRes, okRes;
 
     @BeforeClass
-    public static final void prepareMockvalues() {
+    public static void prepareMockvalues() {
         utils = Mockito.mock(HealthCheckUtils.class);
         client = Mockito.mock(CloseableHttpClient.class);
         nokRes = Mockito.mock(CloseableHttpResponse.class);
@@ -207,11 +201,11 @@
 
         try {
             Mockito.when (client.execute (any(HttpUriRequest.class))).thenReturn (okRes);
-            Boolean res1 = (Boolean)invokeProtectedMethod(tempUtil, "verifyLocalHealth", ip1, port, apihUrl1, sslEnable, null);
+            boolean res1 = tempUtil.verifyLocalHealth(ip1, port, apihUrl1, sslEnable, null);
             assertTrue(res1);
 
             Mockito.when (client.execute (any(HttpUriRequest.class))).thenReturn (nokRes);
-            Boolean res2 = (Boolean)invokeProtectedMethod(tempUtil, "verifyLocalHealth", ip1, port, apihUrl1, sslEnable, null);
+            boolean res2 = tempUtil.verifyLocalHealth(ip1, port, apihUrl1, sslEnable, null);
             assertFalse(res2);
 
         } catch (Exception e) {
@@ -270,29 +264,4 @@
         Mockito.when(utils.loadTopologyProperties()).thenReturn(properties);
     }
 
-    // User reflection to invoke to avoid change the publicity of the method
-    private static Object invokeProtectedMethod (HealthCheckUtils tempUtil, String methodName, String arg1, String arg2, String arg3, String arg4, String arg5) {
-        Method method;
-        try {
-            method = HealthCheckUtils.class.getDeclaredMethod(methodName, String.class, String.class, String.class, String.class, String.class);
-            method.setAccessible(true);
-            return  method.invoke(tempUtil, arg1, arg2, arg3, arg4, arg5);
-        } catch (NoSuchMethodException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (SecurityException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (IllegalAccessException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (IllegalArgumentException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (InvocationTargetException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        return null;
-    }
 }
\ No newline at end of file
