diff --git a/src/schema_compile.c b/src/schema_compile.c
index a62ba98..1500534 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -837,9 +837,6 @@
             /* unimplemented module found */
             if (implement) {
                 LY_CHECK_RET(lys_implement((struct lys_module *)mod, NULL, unres));
-                if (unres->recompile) {
-                    return LY_ERECOMPILE;
-                }
             } else {
                 *mod_p = mod;
                 break;
@@ -1209,14 +1206,6 @@
     LY_ARRAY_COUNT_TYPE v;
     uint32_t i;
 
-    if (unres->recompile) {
-recompilation:
-        assert(unres->recompile);
-        /* recompile all the modules and resolve the new unres instead (during recompilation) */
-        unres->recompile = 0;
-        return lys_recompile(ctx, 1);
-    }
-
     /* fake compile context */
     cctx.ctx = ctx;
     cctx.path_len = 1;
@@ -1252,7 +1241,7 @@
         LOG_LOCBACK(1, 0, 0, 0);
         if (ret == LY_ERECOMPILE) {
             /* leafref caused a new module to be implemented, following leafrefs referencing the module would fail */
-            goto recompilation;
+            return lys_recompile(ctx, 1);
         } else if (ret) {
             return ret;
         }
@@ -1297,7 +1286,7 @@
         ret = lys_compile_unres_xpath(&cctx, node, unres);
         LOG_LOCBACK(1, 0, 0, 0);
         if (ret == LY_ERECOMPILE) {
-            goto recompilation;
+            return lys_recompile(ctx, 1);
         } else if (ret) {
             return ret;
         }
@@ -1320,7 +1309,7 @@
         }
         LOG_LOCBACK(1, 0, 0, 0);
         if (ret == LY_ERECOMPILE) {
-            goto recompilation;
+            return lys_recompile(ctx, 1);
         } else if (ret) {
             return ret;
         }
@@ -1564,20 +1553,8 @@
             continue;
         }
 
-        /* recompile */
-        ret = lys_compile(mod, 0, 1, &unres);
-        if (ret) {
-            if (!log) {
-                LOGERR(mod->ctx, ret, "Recompilation of module \"%s\" failed.", mod->name);
-            }
-            goto cleanup;
-        }
-
-        if (unres.recompile) {
-            /* we need to recompile again (newly compiled module caused another new implemented module) */
-            ret = lys_recompile(ctx, log);
-            goto cleanup;
-        }
+        /* (re)compile the module */
+        LY_CHECK_GOTO(ret = lys_compile(mod, 0, &unres), cleanup);
     }
 
     /* resolve global unres */
@@ -1608,9 +1585,7 @@
 
     LY_CHECK_ARG_RET(NULL, mod, mod->parsed, !mod->compiled, mod->ctx, LY_EINVAL);
 
-    /* if some previous module was not fully compiled, it is forbidden to compile another one (even though it
-     * may be okay in some cases) */
-    assert(mod->implemented && !unres->recompile);
+    assert(mod->implemented);
 
     sp = mod->parsed;
 
