diff --git a/build-debian-packages-pipeline.groovy b/build-debian-packages-pipeline.groovy
index 9e40944..0d9839f 100644
--- a/build-debian-packages-pipeline.groovy
+++ b/build-debian-packages-pipeline.groovy
@@ -28,6 +28,13 @@
   uploadPpa = null
 }
 
+def lintianCheck
+try {
+  lintianCheck = LINTIAN_CHECK.toBoolean()
+} catch (MissingPropertyException e) {
+  lintianCheck = true
+}
+
 def uploadAptly
 try {
   uploadAptly = UPLOAD_APTLY.toBoolean()
@@ -73,13 +80,16 @@
       )
       archiveArtifacts artifacts: "build-area/*.deb"
     }
-    stage("lintian") {
-      changes = sh script: "ls build-area/*_"+ARCH+".changes", returnStdout: true
-      try {
-        debian.runLintian(changes.trim(), OS, OS+":"+DIST)
-      } catch (Exception e) {
-        println "[WARN] Lintian returned non-zero exit status"
-        currentBuild.result = 'UNSTABLE'
+
+    if (lintianCheck) {
+      stage("lintian") {
+        changes = sh script: "ls build-area/*_"+ARCH+".changes", returnStdout: true
+        try {
+          debian.runLintian(changes.trim(), OS, OS+":"+DIST)
+        } catch (Exception e) {
+          println "[WARN] Lintian returned non-zero exit status"
+          currentBuild.result = 'UNSTABLE'
+        }
       }
     }
 
diff --git a/cloud-deploy-pipeline.groovy b/cloud-deploy-pipeline.groovy
index b7e22a8..3c8846c 100644
--- a/cloud-deploy-pipeline.groovy
+++ b/cloud-deploy-pipeline.groovy
@@ -133,7 +133,7 @@
                 //
                 wrap([$class: 'BuildUser']) {
                     if (env.BUILD_USER_ID && !env.BUILD_USER_ID.equals("jenkins") && !STACK_REUSE.toBoolean()) {
-                        def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}", venv)
+                        def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}".replaceAll('_', '-'), venv)
                         if (existingStacks.size() >= _MAX_PERMITTED_STACKS) {
                             STACK_DELETE = "false"
                             throw new Exception("You cannot create new stack, you already have ${_MAX_PERMITTED_STACKS} stacks of this type (${JOB_NAME}). \nStack names: ${existingStacks}")
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index 4422ca6..1494aca 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -3,7 +3,6 @@
  *  DEFAULT_GIT_REF
  *  DEFAULT_GIT_URL
  *  CREDENTIALS_ID
- *  KITCHEN_TESTS_PARALLEL
  */
 def common = new com.mirantis.mk.Common()
 def gerrit = new com.mirantis.mk.Gerrit()
@@ -16,13 +15,6 @@
   gerritRef = null
 }
 
-def parallelGroupSize
-try {
-  parallelGroupSize = Integer.valueOf(PARALLEL_GROUP_SIZE)
-} catch (MissingPropertyException e) {
-  parallelGroupSize = 8
-}
-
 def defaultGitRef, defaultGitUrl
 try {
   defaultGitRef = DEFAULT_GIT_REF
@@ -92,15 +84,9 @@
             common.infoMsg("CUSTOM_KITCHEN_ENVS not empty. Running with custom enviroments: ${kitchenEnvs}")
           }
           if (kitchenEnvs != null && kitchenEnvs != '') {
-            def acc = 0
             def kitchenTestRuns = [:]
             common.infoMsg("Found " + kitchenEnvs.size() + " environment(s)")
             for (int i = 0; i < kitchenEnvs.size(); i++) {
-              if (acc >= parallelGroupSize) {
-                parallel kitchenTestRuns
-                kitchenTestRuns = [:]
-                acc = 0
-              }
               def testEnv = kitchenEnvs[i]
               kitchenTestRuns[testEnv] = {
                 build job: "test-salt-formulas-env", parameters: [
@@ -112,11 +98,8 @@
                   [$class: 'StringParameterValue', name: 'SALT_VERSION', value: SALT_VERSION]
                 ]
               }
-              acc++;
             }
-            if (acc != 0) {
-              parallel kitchenTestRuns
-            }
+            parallel kitchenTestRuns
           } else {
             common.warningMsg(".kitchen.yml file not found, no kitchen tests triggered.")
           }
diff --git a/test-salt-models-pipeline.groovy b/test-salt-models-pipeline.groovy
index 32ef43c..7099954 100644
--- a/test-salt-models-pipeline.groovy
+++ b/test-salt-models-pipeline.groovy
@@ -80,17 +80,23 @@
 
     stage("test-nodes") {
       if(checkouted) {
-        def nodes = sh(script: "find ./nodes -type f -name '${config_node_name_pattern}*.yml'", returnStdout: true).tokenize()
+        def infraYMLs = sh(script: "find ./classes/ -regex '.*cluster/[-_a-zA-Z0-9]*/[infra/]*init\\.yml' -exec grep -il 'cluster_name' {} \\;", returnStdout: true).tokenize()
         def branches = [:]
-        def acc = 0
-        for (int i = 0; i < nodes.size(); i++) {
-          def testTarget = sh(script: "basename ${nodes[i]} .yml", returnStdout: true).trim()
-          def clusterName = testTarget.substring(testTarget.indexOf(".") + 1, testTarget.lastIndexOf("."))
-          if (acc >= PARALLEL_NODE_GROUP_SIZE.toInteger()) {
-            parallel branches
-            branches = [:]
-            acc = 0
+        for (int i = 0; i < infraYMLs.size(); i++) {
+          def infraYMLConfig = readYaml(file: infraYMLs[i])
+          if(!infraYMLConfig["parameters"].containsKey("_param")){
+              common.warningMsg("ERROR: Cannot find soft params (_param) in file " + infraYMLs[i] + " for obtain a cluster info. Skipping test.")
+              continue
           }
+          def infraParams = infraYMLConfig["parameters"]["_param"];
+          if(!infraParams.containsKey("infra_config_hostname") || !infraParams.containsKey("cluster_name") || !infraParams.containsKey("cluster_domain")){
+              common.warningMsg("ERROR: Cannot find _param:infra_config_hostname or _param:cluster_name or _param:cluster_domain  in file " + infraYMLs[i] + " for obtain a cluster info. Skipping test.")
+              continue
+          }
+          def clusterName = infraParams["cluster_name"]
+          def clusterDomain = infraParams["cluster_domain"]
+          def configHostname = infraParams["infra_config_hostname"]
+          def testTarget = String.format("%s.%s", configHostname, clusterDomain)
 
           branches[testTarget] = {
             build job: "test-salt-model-node", parameters: [
@@ -106,11 +112,8 @@
               [$class: 'StringParameterValue', name: 'MAX_CPU_PER_JOB', value: MAX_CPU_PER_JOB],
               [$class: 'StringParameterValue', name: 'SYSTEM_GIT_REF', value: SYSTEM_GIT_REF]
             ]}
-          acc++;
         }
-        if (acc != 0) {
-          parallel branches
-        }
+        parallel branches
       }
     }
   } catch (Throwable e) {
