diff --git a/tcp_tests/managers/execute_commands.py b/tcp_tests/managers/execute_commands.py
index 29e2f4b..3c01867 100644
--- a/tcp_tests/managers/execute_commands.py
+++ b/tcp_tests/managers/execute_commands.py
@@ -64,20 +64,18 @@
             # skip_fail = step.get('skip_fail', False)
 
             msg = "[ {0} #{1} ] {2}".format(label, n + 1, description)
+            LOG.info("\n\n{0}\n{1}".format(msg, '=' * len(msg)))
 
             if action_cmd:
-                self.execute_command(step, msg)
-                return
+                self.execute_command(step)
             elif action_do:
-                self.command2(step, msg)
-                return
-            LOG.info("\n\n{0}\n{1}".format(msg, '=' * len(msg)))
-            if action_upload:
+                self.command2(step)
+            elif action_upload:
                 self.action_upload(step)
             elif action_download:
                 self.action_download(step)
 
-    def execute_command(self, step, msg):
+    def execute_command(self, step):
         # Required fields
         cmd = step.get('cmd')
         node_name = step.get('node_name')
@@ -92,13 +90,7 @@
 
             for x in range(retry_count, 0, -1):
                 time.sleep(3)
-
-                retry_msg = ' (try {0} of {1}, skip_fail={2})'.format(
-                    retry_count - x + 1, retry_count, skip_fail)
-                LOG.info("\n\n{0}\n{1}".format(
-                    msg + retry_msg, '=' * len(msg + retry_msg)))
-
-                result = remote.execute('set -ex; ' + cmd, verbose=True)
+                result = remote.execute(cmd, verbose=True)
 
                 # Workaround of exit code 0 from salt in case of failures
                 failed = 0
@@ -114,11 +106,16 @@
 
                 if result.exit_code != 0:
                     time.sleep(retry_delay)
+                    LOG.info(
+                        " === RETRY ({0}/{1}) ========================="
+                        .format(x - 1, retry_count))
                 elif failed != 0:
                     LOG.error(
                         " === SALT returned exit code = 0 while "
                         "there are failed modules! ===")
-                    time.sleep(retry_delay)
+                    LOG.info(
+                        " === RETRY ({0}/{1}) ======================="
+                        .format(x - 1, retry_count))
                 else:
                     break
 
@@ -127,7 +124,7 @@
                     raise Exception("Step '{0}' failed"
                                     .format(description))
 
-    def command2(self, step, msg):
+    def command2(self, step):
         # Required fields
         do = step['do']
         target = step['target']
@@ -148,11 +145,6 @@
         for x in range(retry_count, 0, -1):
             time.sleep(3)
 
-            retry_msg = ' (try {0} of {1}, skip_fail={2})'.format(
-                retry_count - x + 1, retry_count, skip_fail)
-            LOG.info("\n\n{0}\n{1}".format(
-                msg + retry_msg, '=' * len(msg + retry_msg)))
-
             method = getattr(self._salt, self._salt._map[do])
             command_ret = method(tgt=target, state=state or states,
                                  args=args, kwargs=kwargs)
@@ -171,6 +163,8 @@
                 LOG.error("States finished with failures.\n{}".format(
                     all_fails))
                 time.sleep(retry_delay)
+                LOG.info(" === RETRY ({0}/{1}) ========================="
+                         .format(x - 1, retry_count))
             else:
                 break
 
