diff --git a/software/ors-amarisoft/config/enb.jinja2.cfg b/software/ors-amarisoft/config/enb.jinja2.cfg
index 39be29afe59a610c44c27ae5106bf05542e598de..5edc4a628d783eddfa85a4749b17d3f2d8439a32 100644
--- a/software/ors-amarisoft/config/enb.jinja2.cfg
+++ b/software/ors-amarisoft/config/enb.jinja2.cfg
@@ -24,6 +24,67 @@
 {%- set do_nr  = len(list(icell_dict|dictsort | selectattr('1._.cell_type', '==', 'nr')))  > 0 %}
 
 
+{#- handover_config emits handover configuration for specified cell #}
+{%- macro handover_config(cell_ref)  %}
+          ncell_list: [
+            // Intra-ENB HO
+{%-       for cell2_ref, icell2 in icell_dict|dictsort %}
+{%-         set cell2 = icell2['_']                   %}
+{%-         if cell2_ref != cell_ref %} {#- NOTE: HO to both LTE and NR #}
+            {
+{%-           if cell2.cell_type == 'lte' %}
+              rat:        "eutra",
+              cell_id:    {{ cfg('enb_id') }}{{ cell2.cell_id.removeprefix('0x') }}, // -> {{ cell2_ref }}
+              n_id_cell:  {{ cell2.pci }},
+              dl_earfcn:  {{ cell2.dl_earfcn }},
+              tac:        {{ cell2.tac }},
+{%-           elif cell2.cell_type == 'nr' %}
+              rat:        "nr",
+              cell_id:    {{ cell2.cell_id }},  // -> {{ cell2_ref }}
+{%-           else  %}
+{%-             do bug('unreachable')   %}
+{%-           endif %}
+            },
+{%-         endif %}
+{%-       endfor %}
+
+            // Inter-ENB HO
+{#- TODO: add info about peers as shared instances - one instance per peer *ENB*.
+          then query SlapOS Master about cells configured on that peer ENB and
+          put them as peers here #}
+{%-       for peercell_ref, ipeercell in ipeercell_dict|dictsort %}
+{%-         set ncell = ipeercell['_']  %}
+            {
+{%-           if ncell.peer_cell_type == 'lte' %}
+              rat:          "eutra",
+              cell_id:      {{ ncell.e_cell_id }},  // -> {{ peercell_ref }}
+              n_id_cell:    {{ ncell.pci }},
+              dl_earfcn:    {{ ncell.dl_earfcn }},
+              tac:          {{ ncell.tac }},
+{%-           elif ncell.peer_cell_type == 'nr' %}
+              rat:          "nr",
+              nr_cell_id:   {{ ncell.nr_cell_id }}, // -> {{ peercell_ref }}
+              gnb_id_bits:  {{ ncell.gnb_id_bits }},
+              n_id_cell:    {{ ncell.pci }},
+              dl_nr_arfcn:  {{ ncell.dl_nr_arfcn }},
+              ssb_nr_arfcn: {{ ncell.ssb_nr_arfcn }},
+              ul_nr_arfcn:  {{ ncell.ul_nr_arfcn }},
+              tac:          {{ ncell.tac }},
+              band:         {{ ncell.nr_band }},
+              ssb_subcarrier_spacing: 30,
+              ssb_period: 20,
+              ssb_offset: 0,
+              ssb_duration: 1,
+{%-           else  %}
+{%-             do bug('unreachable')   %}
+{%-           endif %}
+            },
+{%-       endfor %}
+
+          ],
+{%- endmacro %}
+
+
 {#- start of the config -#}
 {
   log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,
@@ -128,63 +189,8 @@
                                     slapparameter_dict.get('root_sequence_index',
                                       204 + i)) }},
 
-          // Handover   XXX same code for both LTE and NR
-          ncell_list: [
-            // Intra-ENB HO
-{%-       for cell2_ref, icell2 in icell_dict|dictsort %}
-{%-         set cell2 = icell2['_']                   %}
-{%-         if cell2_ref != cell_ref %} {#- NOTE: HO to both LTE and NR #}
-            {
-{%-           if cell2.cell_type == 'lte' %}
-              rat:        "eutra",
-              cell_id:    {{ cfg('enb_id') }}{{ cell2.cell_id.removeprefix('0x') }}, // -> {{ cell2_ref }}
-              n_id_cell:  {{ cell2.pci }},
-              dl_earfcn:  {{ cell2.dl_earfcn }},
-              tac:        {{ cell2.tac }},
-{%-           elif cell2.cell_type == 'nr' %}
-              rat:        "nr",
-              cell_id:    {{ cell2.cell_id }},  // -> {{ cell2_ref }}
-{%-           else  %}
-{%-             do bug('unreachable')   %}
-{%-           endif %}
-            },
-{%-         endif %}
-{%-       endfor %}
-
-            // Inter-ENB HO
-{#- TODO: add info about peers as shared instances - one instance per peer *ENB*.
-          then query SlapOS Master about cells configured on that peer ENB and
-          put them as peers here #}
-{%-       for peercell_ref, ipeercell in ipeercell_dict|dictsort %}
-{%-         set ncell = ipeercell['_']  %}
-            {
-{%-           if ncell.peer_cell_type == 'lte' %}
-              rat:          "eutra",
-              cell_id:      {{ ncell.e_cell_id }},  // -> {{ peercell_ref }}
-              n_id_cell:    {{ ncell.pci }},
-              dl_earfcn:    {{ ncell.dl_earfcn }},
-              tac:          {{ ncell.tac }},
-{%-           elif ncell.peer_cell_type == 'nr' %}
-              rat:          "nr",
-              nr_cell_id:   {{ ncell.nr_cell_id }}, // -> {{ peercell_ref }}
-              gnb_id_bits:  {{ ncell.gnb_id_bits }},
-              n_id_cell:    {{ ncell.pci }},
-              dl_nr_arfcn:  {{ ncell.dl_nr_arfcn }},
-              ssb_nr_arfcn: {{ ncell.ssb_nr_arfcn }},
-              ul_nr_arfcn:  {{ ncell.ul_nr_arfcn }},
-              tac:          {{ ncell.tac }},
-              band:         {{ ncell.nr_band }},
-              ssb_subcarrier_spacing: 30,
-              ssb_period: 20,
-              ssb_offset: 0,
-              ssb_duration: 1,
-{%-           else  %}
-{%-             do bug('unreachable')   %}
-{%-           endif %}
-            },
-{%-       endfor %}
-
-          ],
+          // Handover
+{{ handover_config(cell_ref) }}
 
           // Carrier Aggregation: LTE + LTE
           scell_list: [
diff --git a/software/ors-amarisoft/config/out/enb.cfg b/software/ors-amarisoft/config/out/enb.cfg
index b66c97c78eca4fb8d9855fc4bacfe7fd6bab86cd..d77e0b1d502219c10fb5118fae7fd88f0fecd274 100644
--- a/software/ors-amarisoft/config/out/enb.cfg
+++ b/software/ors-amarisoft/config/out/enb.cfg
@@ -65,7 +65,8 @@
           ul_earfcn:    21350,
           root_sequence_index: 204,
 
-          // Handover   XXX same code for both LTE and NR
+          // Handover
+
           ncell_list: [
             // Intra-ENB HO
             {