diff --git a/cfg_checker/common/kube_utils.py b/cfg_checker/common/kube_utils.py
index f6f499d..315f5ee 100644
--- a/cfg_checker/common/kube_utils.py
+++ b/cfg_checker/common/kube_utils.py
@@ -23,18 +23,18 @@
     # Init kube library locally
     _path = "local:{}".format(config.kube_config_path)
     try:
-        kconfig.load_kube_config()
+        kconfig.load_kube_config(config_file=config.kube_config_path)
         if config.insecure:
             kconfig.assert_hostname = False
             kconfig.client_side_validation = False
         logger_cli.debug(
-            "...found Kube env: core, {}". format(
+            "... found Kube env: core, {}". format(
                 ",".join(
                     kclient.CoreApi().get_api_versions().versions
                 )
             )
         )
-        return kconfig, kclient.ApiClient()
+        return kconfig, kclient.ApiClient(), _path
     except Exception as e:
         logger.warn("Failed to init local Kube client: {}".format(
                 str(e)
@@ -63,14 +63,15 @@
     """
     import yaml
     _path = ''
-    if not config.env_name == ENV_LOCAL:
+    # Try to load remote config only if it was not detected already
+    if not config.kube_config_detected and not config.env_name == ENV_LOCAL:
         _path = "{}@{}:{}".format(
             config.ssh_user,
             config.ssh_host,
             config.kube_config_path
         )
         _c_data = ssh_shell_p(
-            "sudo cat " + config.kube_config_path,
+            "cat " + config.kube_config_path,
             config.ssh_host,
             username=config.ssh_user,
             keypath=config.ssh_key,
@@ -116,7 +117,7 @@
         )
     else:
         logger_cli.debug(
-            "...'context' host extracted: '{}' via SSH@{}".format(
+            "... 'context' host extracted: '{}' via SSH@{}".format(
                 _host,
                 config.ssh_host
             )
@@ -128,7 +129,7 @@
         _tmp[0] + "://" + config.mcp_host + ":" + _tmp[2]
     config.kube_port = _tmp[2]
     logger_cli.debug(
-        "...kube remote host updated to {}".format(
+        "... kube remote host updated to {}".format(
             _kube_conf.host
         )
     )
@@ -169,9 +170,11 @@
                 self.config
             )
             self.is_local = True
-            # Load local config data
-            if os.path.exists(self.config.kube_config_path):
-                _c_data = shell("sudo cat " + self.config.kube_config_path)
+            # Try to load local config data
+            if self.config.kube_config_path and \
+               os.path.exists(self.config.kube_config_path):
+                _cmd = "cat " + self.config.kube_config_path
+                _c_data = shell(_cmd)
                 _conf = yaml.load(_c_data, Loader=yaml.SafeLoader)
                 self.user_keypath = create_temp_file_with_content(
                     base64.standard_b64decode(
@@ -277,7 +280,7 @@
         **kwargs
     ):
         logger_cli.debug(
-            "...searching for pods with the name '{}'".format(pod_name)
+            "... searching for pods with the name '{}'".format(pod_name)
         )
         _pods = {}
         _pods = self._coreV1.list_namespaced_pod(namespace)
@@ -288,8 +291,8 @@
             _pnames = [n for n in _names if n.startswith(pod_name)]
             if len(_pnames) > 1:
                 logger_cli.debug(
-                    "...more than one pod found for '{}': {}\n"
-                    "...using first one".format(
+                    "... more than one pod found for '{}': {}\n"
+                    "... using first one".format(
                         pod_name,
                         ", ".join(_pnames)
                     )
@@ -300,7 +303,7 @@
         else:
             _pname = pod_name
         logger_cli.debug(
-            "...cmd: [CoreV1] exec {} -n {} -- {}".format(
+            "... cmd: [CoreV1] exec {} -n {} -- {}".format(
                 _pname,
                 namespace,
                 cmd
