diff --git a/generate-cookiecutter-products.groovy b/generate-cookiecutter-products.groovy
index 2f4f13f..22c803a 100644
--- a/generate-cookiecutter-products.groovy
+++ b/generate-cookiecutter-products.groovy
@@ -69,7 +69,7 @@
     }
     // Check if we are going to test bleeding-edge release, which doesn't have binary release yet
     // After 2018q4 releases, need to also check 'static' repo, for example ubuntu.
-    binTest = common.checkRemoteBinary(['mcp_version': distribRevision])
+    def binTest = common.checkRemoteBinary(['mcp_version': distribRevision])
     if (!binTest.linux_system_repo_url || !binTest.linux_system_repo_ubuntu_url) {
         common.errorMsg("Binary release: ${distribRevision} not exist or not full. Fallback to 'proposed'! ")
         distribRevision = 'proposed'
@@ -93,6 +93,7 @@
         def context = globalVariatorsUpdate()
         def RequesterEmail = context.get('email_address', '')
         def templateEnv = "${env.WORKSPACE}/template"
+        // modelEnv - this is reclass root, aka /srv/salt/reclass
         def modelEnv = "${env.WORKSPACE}/model"
         def testEnv = "${env.WORKSPACE}/test"
         def pipelineEnv = "${env.WORKSPACE}/pipelines"
@@ -119,7 +120,7 @@
             }
             stage('Create empty reclass model') {
                 dir(path: modelEnv) {
-                    sh "rm -rfv .git; git init"
+                    sh 'rm -rfv .git; git init'
                     sshagent(credentials: [gerritCredentials]) {
                         sh "git submodule add ${context['shared_reclass_url']} 'classes/system'"
                     }
@@ -130,7 +131,7 @@
                     extensions       : [[$class: 'RelativeTargetDirectory', relativeTargetDir: systemEnv]],
                     userRemoteConfigs: [[url: context['shared_reclass_url'], refspec: context['shared_reclass_branch'], credentialsId: gerritCredentials],],
                 ])
-                git.commitGitChanges(modelEnv, "Added new shared reclass submodule", "${user}@localhost", "${user}")
+                git.commitGitChanges(modelEnv, 'Added new shared reclass submodule', "${user}@localhost", "${user}")
             }
 
             stage('Generate model') {
@@ -161,9 +162,20 @@
                     if (context.get('cfg_failsafe_ssh_public_key')) {
                         writeFile file: 'failsafe-ssh-key.pub', text: context['cfg_failsafe_ssh_public_key']
                     }
-                    python.setupCookiecutterVirtualenv(cutterEnv)
-                    // FIXME refactor generateModel
-                    python.generateModel(common2.dumpYAML(['default_context': context]), 'default_context', context['salt_master_hostname'], cutterEnv, modelEnv, templateEnv, false)
+                    if (!fileExists(new File(templateEnv, 'tox.ini').toString())) {
+                        python.setupCookiecutterVirtualenv(cutterEnv)
+                        python.generateModel(common2.dumpYAML(['default_context': context]), 'default_context', context['salt_master_hostname'], cutterEnv, modelEnv, templateEnv, false)
+                    } else {
+                        // tox-based CC generated structure of reclass,from the root. Otherwise for bw compat, modelEnv
+                        // still expect only lower lvl of project, aka model/classes/cluster/XXX/. So,lets dump result into
+                        // temp dir, and then copy it over initial structure.
+                        reclassTempRootDir = sh(script: "mktemp -d -p ${env.WORKSPACE}", returnStdout: true).trim()
+                        python.generateModel(common2.dumpYAML(['default_context': context]), 'default_context', context['salt_master_hostname'], cutterEnv, reclassTempRootDir, templateEnv, false)
+                        dir(modelEnv) {
+                            common.warningMsg('Forming reclass-root structure...')
+                            sh("cp -ra ${reclassTempRootDir}/reclass/* .")
+                        }
+                    }
                     git.commitGitChanges(modelEnv, "Create model ${context['cluster_name']}", "${user}@localhost", "${user}")
                 }
             }
@@ -185,7 +197,7 @@
                             'distribRevision'    : distribRevision,
                             'dockerContainerName': DockerCName,
                             'testContext'        : 'salt-model-node',
-                            'dockerExtraOpts'    : [ '--memory=3g' ]
+                            'dockerExtraOpts'    : ['--memory=3g']
                         ]
                         testResult = saltModelTesting.testNode(config)
                         common.infoMsg("Test finished: SUCCESS")
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index 8076041..bd5ec1e 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -116,7 +116,7 @@
         common.infoMsg("StepPrepareGit: ${gerrit_data}")
         // fetch needed sources
         dir(templateEnvFolder) {
-            if (! gerrit_data['gerritRefSpec']) {
+            if (!gerrit_data['gerritRefSpec']) {
                 // Get clean HEAD
                 gerrit_data['useGerritTriggerBuildChooser'] = false
             }
@@ -133,7 +133,26 @@
         for (contextFile in _contextFileList) {
             def basename = common.GetBaseName(contextFile, '.yml')
             def context = readFile(file: "${_templateEnvDir}/contexts/${contextFile}")
-            python.generateModel(context, basename, 'cfg01', _virtualenv, "${_templateEnvDir}/model", _templateEnvDir)
+            if (!fileExists(new File(_templateEnvDir, 'tox.ini').toString())) {
+                common.warningMsg('Forming NEW reclass-root structure...')
+                python.generateModel(context, basename, 'cfg01', _virtualenv, "${_templateEnvDir}/model", _templateEnvDir)
+            } else {
+                // tox-based CC generated structure of reclass,from the root. Otherwise for bw compat, modelEnv
+                // still expect only lower lvl of project, aka model/classes/cluster/XXX/. So,lets dump result into
+                // temp dir, and then copy it over initial structure.
+                def reclassTempRootDir = sh(script: "mktemp -d -p ${env.WORKSPACE}", returnStdout: true).trim()
+                python.generateModel(context, basename, 'cfg01', _virtualenv, reclassTempRootDir, _templateEnvDir)
+                dir("${_templateEnvDir}/model/${basename}/") {
+                    if (fileExists(new File(reclassTempRootDir, 'reclass').toString())) {
+                        common.warningMsg('Forming NEW reclass-root structure...')
+                        sh("cp -ra ${reclassTempRootDir}/reclass/* .")
+                    } else {
+                        // those hack needed only for period release/2019.2.0 => current patch.
+                        common.warningMsg('Forming OLD reclass-root structure...')
+                        sh("mkdir -p classes/cluster/ ; cd classes/cluster/; cp -ra ${reclassTempRootDir}/* .")
+                    }
+                }
+            }
         }
     }
 }
