diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index 34d7169233cc57a50e3ce58015edc8650438149f..3ea23dfb9d1d6453c180f89cff872338f7f9a5a7 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -23,9 +23,6 @@
 
 #include "NR_MAC_UE/mac.h"
 //#include "RRC/LTE/rrc_extern.h"
-#include "PHY_INTERFACE/phy_interface_extern.h"
-
-#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
 //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
 
 #include "fapi_nr_ue_l1.h"
@@ -47,17 +44,12 @@
 
 #include "T.h"
 
-#ifdef XFORMS
-  #include "PHY/TOOLS/nr_phy_scope.h"
-
-  extern char do_forms;
-#endif
+#include "PHY_INTERFACE/phy_interface_extern.h"
 
 // Missing stuff?
 int next_ra_frame = 0;
 module_id_t next_Mod_id = 0;
 
-extern double cpuf;
 //static  nfapi_nr_config_request_t config_t;
 //static  nfapi_nr_config_request_t* config =&config_t;
 
@@ -118,22 +110,6 @@ extern double cpuf;
  *
  */
 
-#ifndef NO_RAT_NR
-  #define DURATION_RX_TO_TX           (NR_UE_CAPABILITY_SLOT_RX_TO_TX)  /* for NR this will certainly depends to such UE capability which is not yet defined */
-#else
-  #define DURATION_RX_TO_TX           (6)   /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */
-#endif
-
-#define FRAME_PERIOD    100000000ULL
-#define DAQ_PERIOD      66667ULL
-
-typedef enum {
-  pss=0,
-  pbch=1,
-  si=2
-} sync_mode_t;
-
-
 void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
                      uint8_t UE_id,
                      uint8_t abstraction_flag)
@@ -179,11 +155,6 @@ void fill_dl_indication(nr_downlink_indication_t *dl_ind, UE_nr_rxtx_proc_t *pro
  * \param arg is a pointer to a \ref PHY_VARS_NR_UE structure.
  */
 
-typedef struct syncData_s {
-  UE_nr_rxtx_proc_t proc;
-  PHY_VARS_NR_UE *UE;
-} syncData_t;
-
 static void UE_synch(void *arg) {
   syncData_t *syncD=(syncData_t *) arg;
   int i, hw_slot_offset;
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index 64fdea0aa2a49e21d996eca68afcdf01e7fe7d28..6e5570270cc03b68526e6a1a8cb6b001a29bb39d 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -158,6 +158,16 @@
 
 #include "targets/ARCH/COMMON/common_lib.h"
 
+#ifndef NO_RAT_NR
+  #define DURATION_RX_TO_TX           (NR_UE_CAPABILITY_SLOT_RX_TO_TX)  /* for NR this will certainly depends to such UE capability which is not yet defined */
+#else
+  #define DURATION_RX_TO_TX           (6)   /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */
+#endif
+
+#define FRAME_PERIOD    100000000ULL
+#define DAQ_PERIOD      66667ULL
+
+#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
 
 /// Context data structure for eNB subframe processing
 typedef struct {
@@ -1146,6 +1156,10 @@ typedef struct nr_rxtx_thread_data_s {
   PHY_VARS_NR_UE    *UE;
 }  nr_rxtx_thread_data_t;
 
+typedef struct syncData_s {
+  UE_nr_rxtx_proc_t proc;
+  PHY_VARS_NR_UE *UE;
+} syncData_t;
 /*static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
 
   if (pthread_mutex_lock(mutex) != 0) {
@@ -1208,6 +1222,11 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *
   return(0);
 }
 */
+typedef enum {
+  pss = 0,
+  pbch = 1,
+  si = 2
+} sync_mode_t;
 
 
 /*
diff --git a/openair1/PHY/phy_extern_nr_ue.h b/openair1/PHY/phy_extern_nr_ue.h
index e06b0c913a68a99715f8a003da939eeadf95b6ba..700419c61c9b9268978b78671c21d5fbbd871787 100644
--- a/openair1/PHY/phy_extern_nr_ue.h
+++ b/openair1/PHY/phy_extern_nr_ue.h
@@ -25,6 +25,11 @@
 #include "PHY/defs_nr_UE.h"
 //#include "common/ran_context.h"
 
+#ifdef XFORMS
+  #include "PHY/TOOLS/nr_phy_scope.h"
+  extern char do_forms;
+#endif
+
 extern char* namepointer_chMag ;
 extern char* namepointer_log2;
 extern char  fmageren_name2[512];
@@ -109,5 +114,8 @@ extern unsigned short Nb_81_110[8][4];
 extern uint16_t hundred_times_log10_NPRB[100];
 extern uint8_t alpha_lut[8];
 extern uint8_t max_turbo_iterations;
+
+extern double cpuf;
+
 #endif /*__PHY_EXTERN_H__ */