diff --git a/src/schema_compile_amend.c b/src/schema_compile_amend.c
index faf2c84..7a24c76 100644
--- a/src/schema_compile_amend.c
+++ b/src/schema_compile_amend.c
@@ -174,19 +174,20 @@
 lys_precompile_uses_augments_refines(struct lysc_ctx *ctx, struct lysp_node_uses *uses_p, const struct lysc_node *ctx_node)
 {
     LY_ERR ret = LY_SUCCESS;
-    LY_ARRAY_COUNT_TYPE u;
     struct lyxp_expr *exp = NULL;
     struct lysc_augment *aug;
+    struct lysp_node_augment *aug_p;
     struct lysc_refine *rfn;
     struct lysp_refine **new_rfn;
+    LY_ARRAY_COUNT_TYPE u;
     uint32_t i;
 
-    LY_ARRAY_FOR(uses_p->augments, u) {
+    LY_LIST_FOR(uses_p->augments, aug_p) {
         lysc_update_path(ctx, NULL, "{augment}");
-        lysc_update_path(ctx, NULL, uses_p->augments[u].nodeid);
+        lysc_update_path(ctx, NULL, aug_p->nodeid);
 
         /* parse the nodeid */
-        LY_CHECK_GOTO(ret = lys_nodeid_check(ctx, uses_p->augments[u].nodeid, 0, NULL, &exp), cleanup);
+        LY_CHECK_GOTO(ret = lys_nodeid_check(ctx, aug_p->nodeid, 0, NULL, &exp), cleanup);
 
         /* allocate new compiled augment and store it in the set */
         aug = calloc(1, sizeof *aug);
@@ -197,7 +198,7 @@
         exp = NULL;
         aug->nodeid_pmod = ctx->pmod;
         aug->nodeid_ctx_node = ctx_node;
-        aug->aug_p = &uses_p->augments[u];
+        aug->aug_p = aug_p;
 
         lysc_update_path(ctx, NULL, NULL);
         lysc_update_path(ctx, NULL, NULL);
@@ -416,8 +417,15 @@
     const struct lysp_node_case *orig_cas;
     struct lysp_node_anydata *any;
     const struct lysp_node_anydata *orig_any;
+    struct lysp_node_action *action;
+    const struct lysp_node_action *orig_action;
+    struct lysp_node_action_inout *action_inout;
+    const struct lysp_node_action_inout *orig_action_inout;
+    struct lysp_node_notif *notif;
+    const struct lysp_node_notif *orig_notif;
 
-    assert(orig->nodetype & (LYS_CONTAINER | LYS_LEAF | LYS_LEAFLIST | LYS_LIST | LYS_CHOICE | LYS_CASE | LYS_ANYDATA));
+    assert(orig->nodetype & (LYS_CONTAINER | LYS_LEAF | LYS_LEAFLIST | LYS_LIST | LYS_CHOICE | LYS_CASE | LYS_ANYDATA |
+            LYS_RPC | LYS_ACTION | LYS_NOTIF));
 
     /* common part */
     LY_CHECK_RET(lysp_node_common_dup(ctx, node, orig));
@@ -485,6 +493,30 @@
 
         DUP_ARRAY(ctx, orig_any->musts, any->musts, lysp_restr_dup);
         break;
+    case LYS_RPC:
+    case LYS_ACTION:
+        action = (struct lysp_node_action *)node;
+        orig_action = (const struct lysp_node_action *)orig;
+
+        action->input.nodetype = orig_action->input.nodetype;
+        action->output.nodetype = orig_action->output.nodetype;
+        /* we do not need the rest */
+        break;
+    case LYS_INPUT:
+    case LYS_OUTPUT:
+        action_inout = (struct lysp_node_action_inout *)node;
+        orig_action_inout = (const struct lysp_node_action_inout *)orig;
+
+        DUP_ARRAY(ctx, orig_action_inout->musts, action_inout->musts, lysp_restr_dup);
+        /* we do not need the rest */
+        break;
+    case LYS_NOTIF:
+        notif = (struct lysp_node_notif *)node;
+        orig_notif = (const struct lysp_node_notif *)orig;
+
+        DUP_ARRAY(ctx, orig_notif->musts, notif->musts, lysp_restr_dup);
+        /* we do not need the rest */
+        break;
     default:
         LOGINT_RET(ctx);
     }
@@ -492,58 +524,6 @@
     return ret;
 }
 
-static LY_ERR
-lysp_action_inout_dup(const struct ly_ctx *ctx, struct lysp_action_inout *inout, const struct lysp_action_inout *orig)
-{
-    inout->parent = NULL;
-    inout->nodetype = orig->nodetype;
-    DUP_ARRAY(ctx, orig->musts, inout->musts, lysp_restr_dup);
-    /* we dot need these arrays */
-    DUP_ARRAY(ctx, orig->exts, inout->exts, lysp_ext_dup);
-
-    return LY_SUCCESS;
-}
-
-static LY_ERR
-lysp_action_dup(const struct ly_ctx *ctx, struct lysp_action *act, const struct lysp_action *orig)
-{
-    LY_ERR ret = LY_SUCCESS;
-
-    act->parent = NULL;
-    act->nodetype = orig->nodetype;
-    act->flags = orig->flags;
-    DUP_STRING(ctx, orig->name, act->name, ret);
-    DUP_STRING(ctx, orig->dsc, act->dsc, ret);
-    DUP_STRING(ctx, orig->ref, act->ref, ret);
-    DUP_ARRAY(ctx, orig->iffeatures, act->iffeatures, lysp_qname_dup);
-
-    act->input.nodetype = orig->input.nodetype;
-    act->output.nodetype = orig->output.nodetype;
-    /* we do not need choldren of in/out */
-    DUP_ARRAY(ctx, orig->exts, act->exts, lysp_ext_dup);
-
-    return ret;
-}
-
-static LY_ERR
-lysp_notif_dup(const struct ly_ctx *ctx, struct lysp_notif *notif, const struct lysp_notif *orig)
-{
-    LY_ERR ret = LY_SUCCESS;
-
-    notif->parent = NULL;
-    notif->nodetype = orig->nodetype;
-    notif->flags = orig->flags;
-    DUP_STRING(ctx, orig->name, notif->name, ret);
-    DUP_STRING(ctx, orig->dsc, notif->dsc, ret);
-    DUP_STRING(ctx, orig->ref, notif->ref, ret);
-    DUP_ARRAY(ctx, orig->iffeatures, notif->iffeatures, lysp_qname_dup);
-    DUP_ARRAY(ctx, orig->musts, notif->musts, lysp_restr_dup);
-    /* we do not need these arrays */
-    DUP_ARRAY(ctx, orig->exts, notif->exts, lysp_ext_dup);
-
-    return ret;
-}
-
 /**
  * @brief Duplicate a single parsed node. Only attributes that are used in compilation are copied.
  *
@@ -567,60 +547,42 @@
     switch (pnode->nodetype) {
     case LYS_CONTAINER:
         mem = calloc(1, sizeof(struct lysp_node_container));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
         break;
     case LYS_LEAF:
         mem = calloc(1, sizeof(struct lysp_node_leaf));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
         break;
     case LYS_LEAFLIST:
         mem = calloc(1, sizeof(struct lysp_node_leaflist));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
         break;
     case LYS_LIST:
         mem = calloc(1, sizeof(struct lysp_node_list));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
         break;
     case LYS_CHOICE:
         mem = calloc(1, sizeof(struct lysp_node_choice));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
         break;
     case LYS_CASE:
         mem = calloc(1, sizeof(struct lysp_node_case));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
         break;
     case LYS_ANYDATA:
     case LYS_ANYXML:
         mem = calloc(1, sizeof(struct lysp_node_anydata));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
         break;
     case LYS_INPUT:
     case LYS_OUTPUT:
-        mem = calloc(1, sizeof(struct lysp_action_inout));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_action_inout_dup(ctx, mem, (struct lysp_action_inout *)pnode), cleanup);
+        mem = calloc(1, sizeof(struct lysp_node_action_inout));
         break;
     case LYS_ACTION:
     case LYS_RPC:
-        mem = calloc(1, sizeof(struct lysp_action));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_action_dup(ctx, mem, (struct lysp_action *)pnode), cleanup);
+        mem = calloc(1, sizeof(struct lysp_node_action));
         break;
     case LYS_NOTIF:
-        mem = calloc(1, sizeof(struct lysp_notif));
-        LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
-        LY_CHECK_GOTO(ret = lysp_notif_dup(ctx, mem, (struct lysp_notif *)pnode), cleanup);
+        mem = calloc(1, sizeof(struct lysp_node_notif));
         break;
     default:
         LOGINT_RET(ctx);
     }
+    LY_CHECK_ERR_GOTO(!mem, LOGMEM(ctx); ret = LY_EMEM, cleanup);
+    LY_CHECK_GOTO(ret = lysp_node_dup(ctx, mem, pnode), cleanup);
 
     if (with_links) {
         /* copy also parent and child pointers */
@@ -903,11 +865,11 @@
             musts = &((struct lysp_node_container *)target)->musts;
             break;
         case LYS_NOTIF:
-            musts = &((struct lysp_notif *)target)->musts;
+            musts = &((struct lysp_node_notif *)target)->musts;
             break;
         case LYS_INPUT:
         case LYS_OUTPUT:
-            musts = &((struct lysp_action_inout *)target)->musts;
+            musts = &((struct lysp_node_action_inout *)target)->musts;
             break;
         default:
             AMEND_WRONG_NODETYPE("deviation", "add", "must");
@@ -1146,11 +1108,11 @@
             musts = &((struct lysp_node_container *)target)->musts;
             break;
         case LYS_NOTIF:
-            musts = &((struct lysp_notif *)target)->musts;
+            musts = &((struct lysp_node_notif *)target)->musts;
             break;
         case LYS_INPUT:
         case LYS_OUTPUT:
-            musts = &((struct lysp_action_inout *)target)->musts;
+            musts = &((struct lysp_node_action_inout *)target)->musts;
             break;
         default:
             AMEND_WRONG_NODETYPE("deviation", "delete", "must");
@@ -1435,7 +1397,7 @@
 
     /* compare names */
     if (pnode->nodetype & (LYS_ACTION | LYS_RPC)) {
-        pname = ((struct lysp_action *)pnode)->name;
+        pname = ((struct lysp_node_action *)pnode)->name;
     } else if (pnode->nodetype & (LYS_INPUT | LYS_OUTPUT)) {
         pname = (pnode->nodetype & LYS_INPUT) ? "input" : "output";
     } else {
@@ -1623,21 +1585,17 @@
         /* no children */
         break;
     case LYS_NOTIF:
-        ((struct lysp_notif *)dev_pnode)->data = NULL;
-        lysp_notif_free((struct ly_ctx *)ctx, (struct lysp_notif *)dev_pnode);
-        free(dev_pnode);
-        return;
+        ((struct lysp_node_notif *)dev_pnode)->data = NULL;
+        break;
     case LYS_RPC:
     case LYS_ACTION:
-        ((struct lysp_action *)dev_pnode)->input.data = NULL;
-        ((struct lysp_action *)dev_pnode)->output.data = NULL;
-        lysp_action_free((struct ly_ctx *)ctx, (struct lysp_action *)dev_pnode);
-        free(dev_pnode);
-        return;
+        ((struct lysp_node_action *)dev_pnode)->input.data = NULL;
+        ((struct lysp_node_action *)dev_pnode)->output.data = NULL;
+        break;
     case LYS_INPUT:
     case LYS_OUTPUT:
-        ((struct lysp_action_inout *)dev_pnode)->data = NULL;
-        lysp_action_inout_free((struct ly_ctx *)ctx, (struct lysp_action_inout *)dev_pnode);
+        ((struct lysp_node_action_inout *)dev_pnode)->data = NULL;
+        lysp_node_free((struct ly_ctx *)ctx, dev_pnode);
         free(dev_pnode);
         return;
     default:
@@ -1794,16 +1752,15 @@
  * @return LY_EVALID on failure.
  */
 static LY_ERR
-lys_compile_augment(struct lysc_ctx *ctx, struct lysp_augment *aug_p, struct lysc_node *target)
+lys_compile_augment(struct lysc_ctx *ctx, struct lysp_node_augment *aug_p, struct lysc_node *target)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lysp_node *pnode;
     struct lysc_node *node;
     struct lysc_when *when_shared = NULL;
-    struct lysc_action **actions;
-    struct lysc_notif **notifs;
+    struct lysc_node_action **actions;
+    struct lysc_node_notif **notifs;
     ly_bool allow_mandatory = 0, enabled;
-    LY_ARRAY_COUNT_TYPE u;
     struct ly_set child_set = {0};
     uint32_t i, opt_prev = ctx->options;
 
@@ -1844,8 +1801,7 @@
             } else {
                 ctx->options |= LYS_COMPILE_RPC_OUTPUT;
             }
-            ret = lys_compile_node(ctx, pnode, (struct lysc_node *)lysc_node_parent_full(target), 0, &child_set);
-            LY_CHECK_GOTO(ret, cleanup);
+            LY_CHECK_GOTO(ret = lys_compile_node(ctx, pnode, target, 0, &child_set), cleanup);
         } else {
             LY_CHECK_GOTO(ret = lys_compile_node(ctx, pnode, target, 0, &child_set), cleanup);
         }
@@ -1907,19 +1863,22 @@
         if (!actions) {
             LOGVAL(ctx->ctx, LYVE_REFERENCE,
                     "Invalid augment of %s node which is not allowed to contain RPC/action node \"%s\".",
-                    lys_nodetype2str(target->nodetype), aug_p->actions[0].name);
+                    lys_nodetype2str(target->nodetype), aug_p->actions->name);
             ret = LY_EVALID;
             goto cleanup;
         }
 
         /* compile actions into the target */
-        COMPILE_OP_ARRAY_GOTO(ctx, aug_p->actions, *actions, target, lys_compile_action, 0, ret, cleanup);
+        LY_LIST_FOR((struct lysp_node *)aug_p->actions, pnode) {
+            LY_CHECK_GOTO(ret = lys_compile_node(ctx, pnode, target, 0, NULL), cleanup);
+        }
 
         if (aug_p->when) {
             /* inherit when */
-            LY_ARRAY_FOR(*actions, u) {
-                ret = lys_compile_when(ctx, aug_p->when, aug_p->flags, lysc_data_node(target),
-                        (struct lysc_node *)&(*actions)[u], &when_shared);
+            struct lysc_node *iter;
+
+            LY_LIST_FOR((struct lysc_node *)*actions, iter) {
+                ret = lys_compile_when(ctx, aug_p->when, aug_p->flags, lysc_data_node(target), iter, &when_shared);
                 LY_CHECK_GOTO(ret, cleanup);
             }
         }
@@ -1928,19 +1887,22 @@
         if (!notifs) {
             LOGVAL(ctx->ctx, LYVE_REFERENCE,
                     "Invalid augment of %s node which is not allowed to contain notification node \"%s\".",
-                    lys_nodetype2str(target->nodetype), aug_p->notifs[0].name);
+                    lys_nodetype2str(target->nodetype), aug_p->notifs->name);
             ret = LY_EVALID;
             goto cleanup;
         }
 
         /* compile notifications into the target */
-        COMPILE_OP_ARRAY_GOTO(ctx, aug_p->notifs, *notifs, target, lys_compile_notif, 0, ret, cleanup);
+        LY_LIST_FOR((struct lysp_node *)aug_p->notifs, pnode) {
+            LY_CHECK_GOTO(ret = lys_compile_node(ctx, pnode, target, 0, NULL), cleanup);
+        }
 
         if (aug_p->when) {
             /* inherit when */
-            LY_ARRAY_FOR(*notifs, u) {
-                ret = lys_compile_when(ctx, aug_p->when, aug_p->flags, lysc_data_node(target),
-                        (struct lysc_node *)&(*notifs)[u], &when_shared);
+            struct lysc_node *iter;
+
+            LY_LIST_FOR((struct lysc_node *)*notifs, iter) {
+                ret = lys_compile_when(ctx, aug_p->when, aug_p->flags, lysc_data_node(target), iter, &when_shared);
                 LY_CHECK_GOTO(ret, cleanup);
             }
         }
@@ -2033,7 +1995,7 @@
  * @return LY_ERR value.
  */
 static LY_ERR
-lys_precompile_own_augment(struct lysc_ctx *ctx, struct lysp_augment *aug_p, const struct lysp_module *pmod)
+lys_precompile_own_augment(struct lysc_ctx *ctx, struct lysp_node_augment *aug_p, const struct lysp_module *pmod)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyxp_expr *exp = NULL;
@@ -2069,22 +2031,21 @@
 LY_ERR
 lys_precompile_own_augments(struct lysc_ctx *ctx)
 {
-    LY_ARRAY_COUNT_TYPE u, v, w;
-    const struct lys_module *aug_mod;
+    LY_ARRAY_COUNT_TYPE u, v;
 
     LY_ARRAY_FOR(ctx->cur_mod->augmented_by, u) {
-        aug_mod = ctx->cur_mod->augmented_by[u];
+        const struct lys_module *aug_mod = ctx->cur_mod->augmented_by[u];
+        struct lysp_node_augment *aug;
 
         /* collect all module augments */
-        LY_ARRAY_FOR(aug_mod->parsed->augments, v) {
-            LY_CHECK_RET(lys_precompile_own_augment(ctx, &aug_mod->parsed->augments[v], aug_mod->parsed));
+        LY_LIST_FOR(aug_mod->parsed->augments, aug) {
+            LY_CHECK_RET(lys_precompile_own_augment(ctx, aug, aug_mod->parsed));
         }
 
         /* collect all submodules augments */
         LY_ARRAY_FOR(aug_mod->parsed->includes, v) {
-            LY_ARRAY_FOR(aug_mod->parsed->includes[v].submodule->augments, w) {
-                LY_CHECK_RET(lys_precompile_own_augment(ctx, &aug_mod->parsed->includes[v].submodule->augments[w],
-                        (struct lysp_module *)aug_mod->parsed->includes[v].submodule));
+            LY_LIST_FOR(aug_mod->parsed->includes[v].submodule->augments, aug) {
+                LY_CHECK_RET(lys_precompile_own_augment(ctx, aug, (struct lysp_module *)aug_mod->parsed->includes[v].submodule));
             }
         }
     }
@@ -2244,6 +2205,7 @@
     const struct lysc_node *target;
     struct lys_module *mod;
     struct lysp_submodule *submod;
+    struct lysp_node_augment *aug;
     ly_bool has_dev = 0;
     uint16_t flags;
     uint32_t idx, opt_prev = ctx->options;
@@ -2260,12 +2222,12 @@
 
     mod_p = ctx->cur_mod->parsed;
 
-    LY_ARRAY_FOR(mod_p->augments, u) {
+    LY_LIST_FOR(mod_p->augments, aug) {
         lysc_update_path(ctx, NULL, "{augment}");
-        lysc_update_path(ctx, NULL, mod_p->augments[u].nodeid);
+        lysc_update_path(ctx, NULL, aug->nodeid);
 
         /* get target module */
-        ret = lys_nodeid_check(ctx, mod_p->augments[u].nodeid, 1, &mod, NULL);
+        ret = lys_nodeid_check(ctx, aug->nodeid, 1, &mod, NULL);
         LY_CHECK_RET(ret);
 
         /* add this module into the target module augmented_by, if not there already from previous augments */
@@ -2275,13 +2237,13 @@
         if (mod != ctx->cur_mod) {
             /* apply the augment, find the target node first */
             flags = 0;
-            ret = lysc_resolve_schema_nodeid(ctx, mod_p->augments[u].nodeid, 0, NULL, ctx->cur_mod, LY_PREF_SCHEMA,
+            ret = lysc_resolve_schema_nodeid(ctx, aug->nodeid, 0, NULL, ctx->cur_mod, LY_PREF_SCHEMA,
                     (void *)mod_p, 0, &target, &flags);
             LY_CHECK_RET(ret);
 
             /* apply the augment */
             ctx->options |= flags;
-            ret = lys_compile_augment(ctx, &mod_p->augments[u], (struct lysc_node *)target);
+            ret = lys_compile_augment(ctx, aug, (struct lysc_node *)target);
             ctx->options = opt_prev;
             LY_CHECK_RET(ret);
         }
@@ -2309,22 +2271,22 @@
     /* the same for augments and deviations in submodules */
     LY_ARRAY_FOR(mod_p->includes, v) {
         submod = mod_p->includes[v].submodule;
-        LY_ARRAY_FOR(submod->augments, u) {
+        LY_LIST_FOR(submod->augments, aug) {
             lysc_update_path(ctx, NULL, "{augment}");
-            lysc_update_path(ctx, NULL, submod->augments[u].nodeid);
+            lysc_update_path(ctx, NULL, aug->nodeid);
 
-            ret = lys_nodeid_check(ctx, submod->augments[u].nodeid, 1, &mod, NULL);
+            ret = lys_nodeid_check(ctx, aug->nodeid, 1, &mod, NULL);
             LY_CHECK_RET(ret);
 
             lys_array_add_mod_ref(ctx, ctx->cur_mod, &mod->augmented_by);
             if (mod != ctx->cur_mod) {
                 flags = 0;
-                ret = lysc_resolve_schema_nodeid(ctx, mod_p->augments[u].nodeid, 0, NULL, ctx->cur_mod, LY_PREF_SCHEMA,
+                ret = lysc_resolve_schema_nodeid(ctx, aug->nodeid, 0, NULL, ctx->cur_mod, LY_PREF_SCHEMA,
                         submod, 0, &target, &flags);
                 LY_CHECK_RET(ret);
 
                 ctx->options |= flags;
-                ret = lys_compile_augment(ctx, &submod->augments[u], (struct lysc_node *)target);
+                ret = lys_compile_augment(ctx, aug, (struct lysc_node *)target);
                 ctx->options = opt_prev;
                 LY_CHECK_RET(ret);
             }
