diff --git a/k6-tests/ncmp/common/cmhandle-crud.js b/k6-tests/ncmp/common/cmhandle-crud.js
index aa3beb3..7fab62a 100644
--- a/k6-tests/ncmp/common/cmhandle-crud.js
+++ b/k6-tests/ncmp/common/cmhandle-crud.js
@@ -18,17 +18,38 @@
  *  ============LICENSE_END=========================================================
  */
 
-import http from 'k6/http';
 import { sleep } from 'k6';
-import {
-    NCMP_BASE_URL, DMI_PLUGIN_URL, TOTAL_CM_HANDLES,
-    MODULE_SET_TAGS, CONTENT_TYPE_JSON_PARAM
+import { performPostRequest, NCMP_BASE_URL, DMI_PLUGIN_URL, TOTAL_CM_HANDLES, MODULE_SET_TAGS
 } from './utils.js';
 import { executeCmHandleIdSearch } from './search-base.js';
 
 export function createCmHandles(cmHandleIds) {
     const url = `${NCMP_BASE_URL}/ncmpInventory/v1/ch`;
-    const payload = {
+    const payload = JSON.stringify(createCmHandlePayload(cmHandleIds));
+    return performPostRequest(url, payload, 'createCmHandles');
+}
+
+export function deleteCmHandles(cmHandleIds) {
+    const url = `${NCMP_BASE_URL}/ncmpInventory/v1/ch`;
+    const payload = JSON.stringify({
+        "dmiPlugin": DMI_PLUGIN_URL,
+        "removedCmHandles": cmHandleIds,
+    });
+    return performPostRequest(url, payload, 'deleteCmHandles');
+}
+
+export function waitForAllCmHandlesToBeReady() {
+    const POLLING_INTERVAL_SECONDS = 5;
+    let cmHandlesReady = 0;
+    do {
+        sleep(POLLING_INTERVAL_SECONDS);
+        cmHandlesReady = getNumberOfReadyCmHandles();
+        console.log(`${cmHandlesReady}/${TOTAL_CM_HANDLES} CM handles are READY`);
+    } while (cmHandlesReady < TOTAL_CM_HANDLES);
+}
+
+function createCmHandlePayload(cmHandleIds) {
+    return {
         "dmiPlugin": DMI_PLUGIN_URL,
         "createdCmHandles": cmHandleIds.map((cmHandleId, index) => ({
             "cmHandle": cmHandleId,
@@ -42,28 +63,6 @@
             }
         })),
     };
-    const response = http.post(url, JSON.stringify(payload), CONTENT_TYPE_JSON_PARAM);
-    return response;
-}
-
-export function deleteCmHandles(cmHandleIds) {
-    const url = `${NCMP_BASE_URL}/ncmpInventory/v1/ch`;
-    const payload = {
-        "dmiPlugin": DMI_PLUGIN_URL,
-        "removedCmHandles": cmHandleIds,
-    };
-    const response = http.post(url, JSON.stringify(payload), CONTENT_TYPE_JSON_PARAM);
-    return response;
-}
-
-export function waitForAllCmHandlesToBeReady() {
-    const POLLING_INTERVAL_SECONDS = 5;
-    let cmHandlesReady = 0;
-    do {
-        sleep(POLLING_INTERVAL_SECONDS);
-        cmHandlesReady = getNumberOfReadyCmHandles();
-        console.log(`${cmHandlesReady}/${TOTAL_CM_HANDLES} CM handles are READY`);
-    } while (cmHandlesReady < TOTAL_CM_HANDLES);
 }
 
 function getNumberOfReadyCmHandles() {
diff --git a/k6-tests/ncmp/common/passthrough-crud.js b/k6-tests/ncmp/common/passthrough-crud.js
index c5f2ddd..0cd96ad 100644
--- a/k6-tests/ncmp/common/passthrough-crud.js
+++ b/k6-tests/ncmp/common/passthrough-crud.js
@@ -18,33 +18,37 @@
  *  ============LICENSE_END=========================================================
  */
 
-import http from 'k6/http';
 import { randomIntBetween } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
-import { TOTAL_CM_HANDLES, CONTENT_TYPE_JSON_PARAM, NCMP_BASE_URL, TOPIC_DATA_OPERATIONS_BATCH_READ } from './utils.js';
+import {
+    performPostRequest,
+    performGetRequest,
+    NCMP_BASE_URL,
+    TOPIC_DATA_OPERATIONS_BATCH_READ,
+    TOTAL_CM_HANDLES
+} from './utils.js';
 
 export function passthroughRead(useAlternateId) {
     const cmHandleReference = getRandomCmHandleReference(useAlternateId);
     const resourceIdentifier = 'my-resource-identifier';
-    const includeDescendants = true;
     const datastoreName = 'ncmp-datastore:passthrough-operational';
-    const url = `${NCMP_BASE_URL}/ncmp/v1/ch/${cmHandleReference}/data/ds/${datastoreName}?resourceIdentifier=${resourceIdentifier}&include-descendants=${includeDescendants}`
-    const response = http.get(url);
-    return response;
+    const includeDescendants = true;
+    const url = generatePassthroughUrl(cmHandleReference, datastoreName, resourceIdentifier, includeDescendants);
+    return performGetRequest(url, 'passthroughRead');
 }
 
 export function passthroughWrite(useAlternateId) {
     const cmHandleReference = getRandomCmHandleReference(useAlternateId);
     const resourceIdentifier = 'my-resource-identifier';
     const datastoreName = 'ncmp-datastore:passthrough-running';
-    const url = `${NCMP_BASE_URL}/ncmp/v1/ch/${cmHandleReference}/data/ds/${datastoreName}?resourceIdentifier=${resourceIdentifier}`
-    const body = `{"neType": "BaseStation"}`
-    const response = http.post(url, JSON.stringify(body), CONTENT_TYPE_JSON_PARAM);
-    return response;
+    const includeDescendants = false;
+    const url = generatePassthroughUrl(cmHandleReference, datastoreName, resourceIdentifier, includeDescendants);
+    const payload = JSON.stringify({"neType": "BaseStation"});
+    return performPostRequest(url, payload, 'passthroughWrite');
 }
 
 export function batchRead(cmHandleIds) {
-    const url = `${NCMP_BASE_URL}/ncmp/v1/data?topic=${TOPIC_DATA_OPERATIONS_BATCH_READ}`
-    const  payload = {
+    const url = `${NCMP_BASE_URL}/ncmp/v1/data?topic=${TOPIC_DATA_OPERATIONS_BATCH_READ}`;
+    const payload = JSON.stringify({
         "operations": [
             {
                 "resourceIdentifier": "parent/child",
@@ -55,12 +59,16 @@
                 "operation": "read"
             }
         ]
-    };
-    const response = http.post(url, JSON.stringify(payload), CONTENT_TYPE_JSON_PARAM);
-    return response;
+    });
+    return performPostRequest(url, payload, 'batchRead');
 }
 
 function getRandomCmHandleReference(useAlternateId) {
     const prefix = useAlternateId ? 'alt' : 'ch';
     return `${prefix}-${randomIntBetween(1, TOTAL_CM_HANDLES)}`;
 }
+
+function generatePassthroughUrl(cmHandleReference, datastoreName, resourceIdentifier, includeDescendants) {
+    const descendantsParam = includeDescendants ? `&include-descendants=${includeDescendants}` : '';
+    return `${NCMP_BASE_URL}/ncmp/v1/ch/${cmHandleReference}/data/ds/${datastoreName}?resourceIdentifier=${resourceIdentifier}${descendantsParam}`;
+}
\ No newline at end of file
diff --git a/k6-tests/ncmp/common/search-base.js b/k6-tests/ncmp/common/search-base.js
index beb3aad..a6424fe 100644
--- a/k6-tests/ncmp/common/search-base.js
+++ b/k6-tests/ncmp/common/search-base.js
@@ -18,8 +18,22 @@
  *  ============LICENSE_END=========================================================
  */
 
-import http from 'k6/http';
-import { NCMP_BASE_URL, CONTENT_TYPE_JSON_PARAM } from './utils.js';
+import {performPostRequest, NCMP_BASE_URL} from './utils.js';
+
+export function executeCmHandleSearch(scenario) {
+    return executeSearchRequest('searches', scenario);
+}
+
+export function executeCmHandleIdSearch(scenario) {
+    return executeSearchRequest('id-searches', scenario);
+}
+
+function executeSearchRequest(searchType, scenario) {
+    const searchParameters = SEARCH_PARAMETERS_PER_SCENARIO[scenario];
+    const payload = JSON.stringify(searchParameters);
+    const url = `${NCMP_BASE_URL}/ncmp/v1/ch/${searchType}`;
+    return performPostRequest(url, payload, searchType);
+}
 
 const SEARCH_PARAMETERS_PER_SCENARIO = {
     "module-and-properties": {
@@ -43,19 +57,3 @@
         ]
     }
 };
-
-export function executeCmHandleSearch(scenario) {
-    return executeSearchRequest('searches', scenario);
-}
-
-export function executeCmHandleIdSearch(scenario) {
-    return executeSearchRequest('id-searches', scenario);
-}
-
-function executeSearchRequest(searchType, scenario) {
-    const searchParameters = SEARCH_PARAMETERS_PER_SCENARIO[scenario];
-    const payload = JSON.stringify(searchParameters);
-    const url = `${NCMP_BASE_URL}/ncmp/v1/ch/${searchType}`;
-    const response = http.post(url, payload, CONTENT_TYPE_JSON_PARAM);
-    return response;
-}
diff --git a/k6-tests/ncmp/common/utils.js b/k6-tests/ncmp/common/utils.js
index 8391d5c..e6d9c92 100644
--- a/k6-tests/ncmp/common/utils.js
+++ b/k6-tests/ncmp/common/utils.js
@@ -18,13 +18,14 @@
  *  ============LICENSE_END=========================================================
  */
 
+import http from 'k6/http';
 export const NCMP_BASE_URL = 'http://localhost:8883';
 export const DMI_PLUGIN_URL = 'http://ncmp-dmi-plugin-demo-and-csit-stub:8092';
 export const TOTAL_CM_HANDLES = 20000;
 export const REGISTRATION_BATCH_SIZE = 100;
 export const READ_DATA_FOR_CM_HANDLE_DELAY_MS = 300; // must have same value as in docker-compose.yml
 export const WRITE_DATA_FOR_CM_HANDLE_DELAY_MS = 670; // must have same value as in docker-compose.yml
-export const CONTENT_TYPE_JSON_PARAM = { headers: {'Content-Type': 'application/json'} };
+export const CONTENT_TYPE_JSON_PARAM = {'Content-Type': 'application/json'};
 export const DATA_OPERATION_READ_BATCH_SIZE = 200;
 export const TOPIC_DATA_OPERATIONS_BATCH_READ = 'topic-data-operations-batch-read';
 export const KAFKA_BOOTSTRAP_SERVERS = ['localhost:9092'];
@@ -42,6 +43,43 @@
     return Array.from({ length: batchSize }, (_, i) => `ch-${startIndex + i}`);
 }
 
+/**
+ * Helper function to perform POST requests with JSON payload and content type.
+ * @param {string} url - The URL to send the POST request to.
+ * @param {Object} payload - The JSON payload to send in the POST request.
+ * @param {string} metricTag - A tag for the metric endpoint.
+ * @returns {Object} The response from the HTTP POST request.
+ */
+export function performPostRequest(url, payload, metricTag) {
+    const metricTags = {
+        endpoint: metricTag
+    };
+
+    return http.post(url, payload, {
+        headers: CONTENT_TYPE_JSON_PARAM,
+        tags: metricTags
+    });
+}
+
+/**
+ * Helper function to perform GET requests with metric tags.
+ *
+ * This function sends an HTTP GET request to the specified URL and attaches
+ * a metric tag to the request, which is useful for monitoring and analytics.
+ *
+ * @param {string} url - The URL to which the GET request will be sent.
+ * @param {string} metricTag - A string representing the metric tag to associate with the request.
+ *                             This tag is used for monitoring and tracking the request.
+ * @returns {Object} The response from the HTTP GET request. The response includes the status code,
+ *                   headers, body, and other related information.
+ */
+export function performGetRequest(url, metricTag) {
+    const metricTags = {
+        endpoint: metricTag
+    };
+    return http.get(url, {tags: metricTags});
+}
+
 export function makeCustomSummaryReport(data, options) {
     const summaryCsvLines = [
         '#,Test Name,Unit,Limit,Actual',
