diff --git a/cfg_checker/modules/packages/checker.py b/cfg_checker/modules/packages/checker.py
index 3225f70..0bcb1a6 100644
--- a/cfg_checker/modules/packages/checker.py
+++ b/cfg_checker/modules/packages/checker.py
@@ -3,13 +3,13 @@
 from cfg_checker.common import const, logger_cli
 from cfg_checker.common.exception import ConfigException
 from cfg_checker.helpers.console_utils import Progress
-from cfg_checker.nodes import SaltNodes
+from cfg_checker.nodes import salt_master
 from cfg_checker.reports import reporter
 
 from versions import DebianVersion, PkgVersions, VersionCmpResult
 
 
-class CloudPackageChecker(SaltNodes):
+class CloudPackageChecker(object):
     @staticmethod
     def presort_packages(all_packages, full=None):
         logger_cli.info("-> Presorting packages")
@@ -52,14 +52,14 @@
             # sort packages
             _pn, _val = all_packages.popitem()
             _c = _val['desc']['component']
-            if full:
+            if not full:
                 # Check if this packet has errors
                 # if all is ok -> just skip it
                 _max_status = max(_val['results'].keys())
                 if _max_status <= const.VERSION_OK:
                     _max_action = max(_val['results'][_max_status].keys())
                     if _max_action == const.ACT_NA:
-                        # this package do not ha any comments
+                        # this package do not has any comments
                         # ...just skip it from report
                         continue
 
@@ -118,9 +118,12 @@
         :return: none
         """
         logger_cli.info("# Collecting installed packages")
-        _result = self.execute_script_on_active_nodes("pkg_versions.py")
+        if not salt_master.nodes:
+            salt_master.nodes = salt_master.get_nodes()
+        salt_master.prepare_script_on_active_nodes("pkg_versions.py")
+        _result = salt_master.execute_script_on_active_nodes("pkg_versions.py")
 
-        for key in self.nodes.keys():
+        for key in salt_master.nodes.keys():
             # due to much data to be passed from salt, it is happening in order
             if key in _result:
                 _text = _result[key]
@@ -135,12 +138,12 @@
                     )
                     _dict = {}
 
-                self.nodes[key]['packages'] = _dict
+                salt_master.nodes[key]['packages'] = _dict
             else:
-                self.nodes[key]['packages'] = {}
+                salt_master.nodes[key]['packages'] = {}
             logger_cli.debug("... {} has {} packages installed".format(
                 key,
-                len(self.nodes[key]['packages'].keys())
+                len(salt_master.nodes[key]['packages'].keys())
             ))
         logger_cli.info("-> Done")
 
@@ -156,12 +159,12 @@
         logger_cli.info(
             "# Cross-comparing: Installed vs Candidates vs Release"
         )
-        _progress = Progress(len(self.nodes.keys()))
+        _progress = Progress(len(salt_master.nodes.keys()))
         _progress_index = 0
         _total_processed = 0
         # Collect packages from all of the nodes in flat dict
         _all_packages = {}
-        for node_name, node_value in self.nodes.iteritems():
+        for node_name, node_value in salt_master.nodes.iteritems():
             _uniq_len = len(_all_packages.keys())
             _progress_index += 1
             # progress will jump from node to node
@@ -182,8 +185,8 @@
                 # All packages list with version and node list
                 if _name not in _all_packages:
                     # shortcuts for this cloud values
-                    _os = self.openstack_release
-                    _mcp = self.mcp_release
+                    _os = salt_master.openstack_release
+                    _mcp = salt_master.mcp_release
                     _pkg_desc = {}
                     if _desc[_name]:
                         # shortcut to version library
@@ -256,9 +259,9 @@
             filename
         )
         payload = {
-            "nodes": self.nodes,
-            "mcp_release": self.mcp_release,
-            "openstack_release": self.openstack_release
+            "nodes": salt_master.nodes,
+            "mcp_release": salt_master.mcp_release,
+            "openstack_release": salt_master.openstack_release
         }
         payload.update(self.presort_packages(self._packages, full))
         _report(payload)
