diff --git a/bip/main.py b/bip/main.py
index cea402ea829a8b32883beb60aad4bc46582de0c1..c0dc3871012cd0798d5d7fe7ef448c9a5020764b 100755
--- a/bip/main.py
+++ b/bip/main.py
@@ -16,7 +16,7 @@ from dataclasses import dataclass, field
 from file_tree import FileTree
 from pipe_tree import Pipeline, Ref
 import bip
-from bip.utils import setup_logging
+from bip.utils.log_utils           import setup_logging
 from bip.pipelines.struct_T1       import struct_T1
 from bip.pipelines.struct_T2_FLAIR import struct_T2_FLAIR
 from bip.pipelines.struct_FS       import struct_FS
diff --git a/bip/pipelines/dMRI_diff/dMRI_diff.py b/bip/pipelines/dMRI_diff/dMRI_diff.py
index 486336651766f61527d905b89555041c06455685..d2135837221609cdba0d85988780d51e427db069 100755
--- a/bip/pipelines/dMRI_diff/dMRI_diff.py
+++ b/bip/pipelines/dMRI_diff/dMRI_diff.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils     import redirect_logging
 from bip.pipelines.dMRI_diff import diff_eddy
 from bip.pipelines.dMRI_diff import diff_dtifit
 from bip.pipelines.dMRI_diff import diff_noddi
diff --git a/bip/pipelines/dMRI_diff/diff_autoptx.py b/bip/pipelines/dMRI_diff/diff_autoptx.py
index 12557567d9fc6fbba191d8980149a9b92e75da9a..894dc2d42934c7f705e7468cd42d785d018a5b28 100755
--- a/bip/pipelines/dMRI_diff/diff_autoptx.py
+++ b/bip/pipelines/dMRI_diff/diff_autoptx.py
@@ -15,7 +15,7 @@ import random
 import logging
 from shutil import copyfile
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref, Var
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/dMRI_diff/diff_bedpostx.py b/bip/pipelines/dMRI_diff/diff_bedpostx.py
index d8e5acd3a5f70e99e5d12352c07b72b44f5e5e32..3cf8ace1d575b2a4b8c20e27ebb33d1a1d950d8e 100755
--- a/bip/pipelines/dMRI_diff/diff_bedpostx.py
+++ b/bip/pipelines/dMRI_diff/diff_bedpostx.py
@@ -14,7 +14,7 @@ import os
 import logging
 from shutil import copyfile
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/dMRI_diff/diff_dtifit.py b/bip/pipelines/dMRI_diff/diff_dtifit.py
index 1b7b8c68977450ce0cdf202cd644743ca4407b67..43c6e6c597b4cc3dae2575b828da578c628031d3 100755
--- a/bip/pipelines/dMRI_diff/diff_dtifit.py
+++ b/bip/pipelines/dMRI_diff/diff_dtifit.py
@@ -14,7 +14,7 @@ import logging
 from shutil import copyfile
 import numpy as np
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
 
diff --git a/bip/pipelines/dMRI_diff/diff_eddy.py b/bip/pipelines/dMRI_diff/diff_eddy.py
index 9c710b23b9c6cffbf140229f0e5cd73b3ab4f7ed..ae947ca1800d963fc14aafbbc39233a88ffa0963 100755
--- a/bip/pipelines/dMRI_diff/diff_eddy.py
+++ b/bip/pipelines/dMRI_diff/diff_eddy.py
@@ -15,7 +15,7 @@ import logging
 from shutil import copyfile
 import nibabel as nib
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/dMRI_diff/diff_noddi.py b/bip/pipelines/dMRI_diff/diff_noddi.py
index a7252ece6ad14f9c1575d3b94f7f8d27b4445e23..8d36809bffb5b623a3496330968364208e0d8256 100755
--- a/bip/pipelines/dMRI_diff/diff_noddi.py
+++ b/bip/pipelines/dMRI_diff/diff_noddi.py
@@ -16,7 +16,7 @@ import zipfile
 import gzip
 import shutil
 import amico
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 from pipe_tree import In, Out, Ref
 
 
diff --git a/bip/pipelines/dMRI_diff/diff_tbss.py b/bip/pipelines/dMRI_diff/diff_tbss.py
index f490e92fc6ddba2cb11f52049fdf98abc23e2388..04c5482733918b312f5ced61e15d21b37eb35eaf 100755
--- a/bip/pipelines/dMRI_diff/diff_tbss.py
+++ b/bip/pipelines/dMRI_diff/diff_tbss.py
@@ -15,7 +15,7 @@ import logging
 from shutil import copyfile
 import nibabel as nib
 from fsl import wrappers
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py b/bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py
index d320f0156fe2cbaa76e92a8328a63e4875830419..22470f92f1d461f9cc1780044a6752a01158e644 100644
--- a/bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py
+++ b/bip/pipelines/dMRI_fieldmap/dMRI_fieldmap.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils         import redirect_logging
 from bip.pipelines.dMRI_fieldmap import fieldmap_pre_topup
 from bip.pipelines.dMRI_fieldmap import fieldmap_topup
 from bip.pipelines.dMRI_fieldmap import fieldmap_post_topup
diff --git a/bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py b/bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py
index 4e1bfdb42003519763987110cbdfb76f327bfa95..cef087bd17c1fdb79bd97dec3ea55ebfcd2456fb 100755
--- a/bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py
+++ b/bip/pipelines/dMRI_fieldmap/fieldmap_post_topup.py
@@ -14,7 +14,7 @@ from shutil import copyfile
 import numpy as np
 import nibabel as nib
 from fsl import wrappers
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 from pipe_tree import In, Out, Ref
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
 
diff --git a/bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py b/bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py
index ab472fe7b8dfec9b94066367072110a31325af76..f6b2084919bf80dd3634d51e9a35fe5cbe612a57 100755
--- a/bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py
+++ b/bip/pipelines/dMRI_fieldmap/fieldmap_pre_topup.py
@@ -16,9 +16,10 @@ from shutil import copyfile
 import numpy as np
 import nibabel as nib
 from fsl import wrappers
-from bip.utils import redirect_logging, tempdir
-from bip.commands import get_b0s, get_dwell_time
-from bip.commands.read_json_field import read_json_field
+from bip.utils.log_utils       import redirect_logging, tempdir
+from bip.utils.get_b0s         import get_b0s
+from bip.utils.get_dwell_time  import get_dwell_time
+from bip.utils.read_json_field import read_json_field
 from pipe_tree import In, Out, Ref
 
 
@@ -39,7 +40,7 @@ def choose_best_B0(ctx, img, bval, total_B0, indices, tmp, best_index, B0,
     else:
         num_vols = len(np.where(bvals <= b0_threshold)[0])
 
-    get_b0s.get_b0s(img, bval, total_B0, indices, num_vols,  b0_threshold)
+    get_b0s(img, bval, total_B0, indices, num_vols,  b0_threshold)
     ind_values = [int(x) for x in np.loadtxt(indices)]
 
     wrappers.fslsplit(total_B0, tmp)
@@ -142,7 +143,7 @@ def generate_acqparams(AP, PA, AP_json, PA_json, numAP, numPA, acqparams):
     imAP = nib.load(AP)
     numlines = imAP.header['dim'][dim_AP]
 
-    dtiDwell = get_dwell_time.get_dt(AP, AP_json)
+    dtiDwell = get_dwell_time(AP, AP_json)
 
     topupValue = (dtiDwell * (numlines -1)) / 1000.0
 
diff --git a/bip/pipelines/dMRI_fieldmap/fieldmap_topup.py b/bip/pipelines/dMRI_fieldmap/fieldmap_topup.py
index 15bf030c1d03ad8bca725c949676cf88c35f7d25..f06c097df12b0468402bfc4ffd896dcd8664e29b 100755
--- a/bip/pipelines/dMRI_fieldmap/fieldmap_topup.py
+++ b/bip/pipelines/dMRI_fieldmap/fieldmap_topup.py
@@ -12,7 +12,7 @@
 
 import logging
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/fMRI_rest/fMRI_rest.py b/bip/pipelines/fMRI_rest/fMRI_rest.py
index 3c1238ebc2627ec9576c557d7f7c92fc9a355e3c..2878a7b27a07f485b8b6132fe29a6f416020239e 100755
--- a/bip/pipelines/fMRI_rest/fMRI_rest.py
+++ b/bip/pipelines/fMRI_rest/fMRI_rest.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils     import redirect_logging
 from bip.pipelines.fMRI_rest import rfMRI_prepare
 from bip.pipelines.fMRI_rest import rfMRI_melodic
 from bip.pipelines.fMRI_rest import rfMRI_fix
diff --git a/bip/pipelines/fMRI_rest/rfMRI_fix.py b/bip/pipelines/fMRI_rest/rfMRI_fix.py
index 9899d50788c752fa03ee46ff91e4e3199e8c96ca..6248401b1eeff9e49df541b096d61adb3a246922 100755
--- a/bip/pipelines/fMRI_rest/rfMRI_fix.py
+++ b/bip/pipelines/fMRI_rest/rfMRI_fix.py
@@ -14,7 +14,7 @@ import logging
 from shutil import copyfile
 from pipe_tree import In, Out, Ref
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pyfix import extract, legacy, io, clean, classify
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/fMRI_rest/rfMRI_melodic.py b/bip/pipelines/fMRI_rest/rfMRI_melodic.py
index b38b69dd2aefd7d6062be4b2d3dad8a8bc992226..6e6c3b9c4aaa3dc407a01a5cdc387590321e40f8 100755
--- a/bip/pipelines/fMRI_rest/rfMRI_melodic.py
+++ b/bip/pipelines/fMRI_rest/rfMRI_melodic.py
@@ -15,7 +15,7 @@ import os
 import shutil
 import logging
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/fMRI_rest/rfMRI_netmats.py b/bip/pipelines/fMRI_rest/rfMRI_netmats.py
index 94193850f3112c339fa9d6b25f1a82f79a274b02..c110d3d82b5fbd22c88be835b83e805668be43c7 100755
--- a/bip/pipelines/fMRI_rest/rfMRI_netmats.py
+++ b/bip/pipelines/fMRI_rest/rfMRI_netmats.py
@@ -13,7 +13,7 @@ import os
 import logging
 from fsl import wrappers
 from pipe_tree import In, Out, Ref, Var
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from bip.pipelines.fMRI_rest.rfMRI_netmats_fnc import ICA_dr
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/fMRI_rest/rfMRI_prepare.py b/bip/pipelines/fMRI_rest/rfMRI_prepare.py
index f4968295a9c9896295fbf30ccafdce331ee37ad4..8af1d403bf28f17c91b32d15e2d551ddc796ab29 100755
--- a/bip/pipelines/fMRI_rest/rfMRI_prepare.py
+++ b/bip/pipelines/fMRI_rest/rfMRI_prepare.py
@@ -16,8 +16,8 @@ from shutil import copyfile
 import nibabel as nib
 from pipe_tree import In, Out, Ref
 from fsl import wrappers
-from bip.commands import get_dwell_time
-from bip.utils import redirect_logging
+from bip.utils.get_dwell_time import get_dwell_time
+from bip.utils.log_utils      import redirect_logging
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
 
 log = logging.getLogger(__name__)
@@ -70,7 +70,7 @@ def run(ctx,
         fMRI_img   = nib.load(rfMRI)
         fmriNumVol = fMRI_img.header['dim'][4]
         fmriTR     = fMRI_img.header['pixdim'][4]
-        fmriDwell  = get_dwell_time.get_dt(rfMRI, rfMRI_json)
+        fmriDwell  = get_dwell_time(rfMRI, rfMRI_json)
         fmriTE     = 39 # Default value for task fMRI TE
         descrip    = str(fMRI_img.header['descrip'])
 
diff --git a/bip/pipelines/fMRI_task/fMRI_task.py b/bip/pipelines/fMRI_task/fMRI_task.py
index f30fd94ea0a90c119708b475130a85d622a3b8cc..120ebe4654942414736aa45fa4be330a0b4eaa47 100755
--- a/bip/pipelines/fMRI_task/fMRI_task.py
+++ b/bip/pipelines/fMRI_task/fMRI_task.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils     import redirect_logging
 from bip.pipelines.fMRI_task import tfMRI_prepare
 from bip.pipelines.fMRI_task import tfMRI_feat
 
diff --git a/bip/pipelines/fMRI_task/tfMRI_feat.py b/bip/pipelines/fMRI_task/tfMRI_feat.py
index 54706afb7ffd885780d61517566067dc66726614..0c58b8371d4eab3a9bb3bb39ec8e93db70023573 100755
--- a/bip/pipelines/fMRI_task/tfMRI_feat.py
+++ b/bip/pipelines/fMRI_task/tfMRI_feat.py
@@ -12,7 +12,7 @@
 
 import logging
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/fMRI_task/tfMRI_prepare.py b/bip/pipelines/fMRI_task/tfMRI_prepare.py
index 3eef64b51aa4887164fbff975de178b302adc464..06bc292f207f208142074a436bb2c35fd8fcbeb4 100755
--- a/bip/pipelines/fMRI_task/tfMRI_prepare.py
+++ b/bip/pipelines/fMRI_task/tfMRI_prepare.py
@@ -16,8 +16,8 @@ from shutil import copyfile
 import nibabel as nib
 from pipe_tree import In, Out, Ref
 from fsl import wrappers
-from bip.commands import get_dwell_time
-from bip.utils import redirect_logging
+from bip.utils.get_dwell_time import get_dwell_time
+from bip.utils.log_utils      import redirect_logging
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
 
 log = logging.getLogger(__name__)
@@ -69,7 +69,7 @@ def run(ctx,
         fMRI_img   = nib.load(tfMRI)
         fmriNumVol = fMRI_img.header['dim'][4]
         fmriTR     = fMRI_img.header['pixdim'][4]
-        fmriDwell  = get_dwell_time.get_dt(tfMRI, tfMRI_json)
+        fmriDwell  = get_dwell_time(tfMRI, tfMRI_json)
         fmriTE     = 39 # Default value for task fMRI TE
         descrip    = str(fMRI_img.header['descrip'])
 
diff --git a/bip/pipelines/struct_FS/FS_get_IDPs.py b/bip/pipelines/struct_FS/FS_get_IDPs.py
index 4d19117d079591231a7f9e948007fb80737f9920..361e25017f6754cd8e562077c94bb21f1384487b 100755
--- a/bip/pipelines/struct_FS/FS_get_IDPs.py
+++ b/bip/pipelines/struct_FS/FS_get_IDPs.py
@@ -12,7 +12,7 @@
 
 import logging
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_FS/FS_proc.py b/bip/pipelines/struct_FS/FS_proc.py
index 6a654e99d77b95acdf5d3086ecf860631e37b996..28f239647aa790138bdd9e64b793872f780c846d 100755
--- a/bip/pipelines/struct_FS/FS_proc.py
+++ b/bip/pipelines/struct_FS/FS_proc.py
@@ -15,8 +15,7 @@ import shutil
 import logging
 import subprocess
 from pipe_tree import In, Out, Ref
-#from bip import ext_wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_FS/FS_segm.py b/bip/pipelines/struct_FS/FS_segm.py
index 94d33618fab0b249e4b8b9cf77a761f06afaea90..ae59e4e71c9f8c8c8f9e69ef1f18a0dafddfb329 100755
--- a/bip/pipelines/struct_FS/FS_segm.py
+++ b/bip/pipelines/struct_FS/FS_segm.py
@@ -17,8 +17,8 @@ from shutil import copyfile
 from fsl import wrappers
 from pipe_tree import In, Out, Ref
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
-from bip.utils import redirect_logging
-from bip.commands.bb_read_json_field import bb_read_json_field
+from bip.utils.log_utils       import redirect_logging
+from bip.utils.read_json_field import read_json_field
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_FS/struct_FS.py b/bip/pipelines/struct_FS/struct_FS.py
index a3df06c3aa1b0474f41d43f77fc83bda1b4ad101..79613a5802f2fd8e8be8efd82b2c50a36adf92c0 100755
--- a/bip/pipelines/struct_FS/struct_FS.py
+++ b/bip/pipelines/struct_FS/struct_FS.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils     import redirect_logging
 from bip.pipelines.struct_FS import FS_proc#, FS_segm, FS_get_IDPs
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T1/T1_QC_CNR_corners.py b/bip/pipelines/struct_T1/T1_QC_CNR_corners.py
index fee070156fd7ba86e97a6975cca45124d8330a03..aa1144ab3a1cd49d1704aef64a3512e0966802a6 100755
--- a/bip/pipelines/struct_T1/T1_QC_CNR_corners.py
+++ b/bip/pipelines/struct_T1/T1_QC_CNR_corners.py
@@ -13,7 +13,7 @@
 import logging
 from fsl import wrappers
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_T1/T1_QC_CNR_eyes.py b/bip/pipelines/struct_T1/T1_QC_CNR_eyes.py
index 5bc8dfbd0e350ebfed18c2c0e7e510279df0457e..d4a3eabc100d2d897528ab3ff22546faa04556eb 100755
--- a/bip/pipelines/struct_T1/T1_QC_CNR_eyes.py
+++ b/bip/pipelines/struct_T1/T1_QC_CNR_eyes.py
@@ -16,7 +16,7 @@ import logging
 import nibabel as nib
 from fsl import wrappers
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_T1/T1_QC_COG.py b/bip/pipelines/struct_T1/T1_QC_COG.py
index 5d4ea84d01f68d491cf1256ec4448e65ed503d2a..3e48b4e572ede426a4c9b2cb8e455f86bac7a69d 100755
--- a/bip/pipelines/struct_T1/T1_QC_COG.py
+++ b/bip/pipelines/struct_T1/T1_QC_COG.py
@@ -13,7 +13,7 @@ import logging
 import numpy as np
 import nibabel as nib
 from fsl import wrappers
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T1/T1_brain_extract.py b/bip/pipelines/struct_T1/T1_brain_extract.py
index 221507a11196f0de40b2ae7351bd3e7baf7d4c5e..57d545e0b56a3d0ef557dfdb66fdd8e0a2a3dd92 100755
--- a/bip/pipelines/struct_T1/T1_brain_extract.py
+++ b/bip/pipelines/struct_T1/T1_brain_extract.py
@@ -14,7 +14,7 @@
 import logging
 from shutil import copyfile
 from fsl import wrappers
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 from pipe_tree import In, Out, Ref, update_closure
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T1/T1_defacing.py b/bip/pipelines/struct_T1/T1_defacing.py
index ff1ff7f2c8d39e9ea1047f01d678c0336104680e..67a38c1e69cfca947428597e7e70d6551b272944 100755
--- a/bip/pipelines/struct_T1/T1_defacing.py
+++ b/bip/pipelines/struct_T1/T1_defacing.py
@@ -12,7 +12,7 @@
 import logging
 from fsl import wrappers
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_T1/T1_fast.py b/bip/pipelines/struct_T1/T1_fast.py
index c912330a8bafaed6e2bd99e75a519796f5bb29a0..2bccfee1d5d2afa75390cfb1a3cdcb0c9cbbb3eb 100755
--- a/bip/pipelines/struct_T1/T1_fast.py
+++ b/bip/pipelines/struct_T1/T1_fast.py
@@ -12,7 +12,7 @@
 
 import logging
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref, update_closure
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T1/T1_first.py b/bip/pipelines/struct_T1/T1_first.py
index 02729a48189bc2b7b87c2c911e6972e39691fb98..8b1ca75033689c234d1adf751c2983e66375d886 100755
--- a/bip/pipelines/struct_T1/T1_first.py
+++ b/bip/pipelines/struct_T1/T1_first.py
@@ -15,7 +15,7 @@ import glob
 import logging
 from pipe_tree import In, Out, Ref
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T1/T1_gdc.py b/bip/pipelines/struct_T1/T1_gdc.py
index bf8f7e4c609926ea6c22d3f798f91b7a749fcbb8..35cc6bd5e18b527ab08f4c296b2d7054c893142a 100755
--- a/bip/pipelines/struct_T1/T1_gdc.py
+++ b/bip/pipelines/struct_T1/T1_gdc.py
@@ -12,7 +12,7 @@
 import logging
 from shutil import copyfile
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T1/T1_sienax.py b/bip/pipelines/struct_T1/T1_sienax.py
index e87593333998c70934911041d7e515e1952dfee4..ba31328cef99d145e7fe05c48b951db99772a151 100755
--- a/bip/pipelines/struct_T1/T1_sienax.py
+++ b/bip/pipelines/struct_T1/T1_sienax.py
@@ -13,7 +13,7 @@ import os
 import logging
 from fsl import wrappers
 from fsl.transform import affine, flirt
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T1/struct_T1.py b/bip/pipelines/struct_T1/struct_T1.py
index c9138ccb7e004acf2fa9c23c94c874411c2e5176..438744cf1b4a96c8eb47b5b2169feace5b0d6e43 100755
--- a/bip/pipelines/struct_T1/struct_T1.py
+++ b/bip/pipelines/struct_T1/struct_T1.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils     import redirect_logging
 from bip.pipelines.struct_T1 import T1_gdc, T1_brain_extract, T1_defacing
 from bip.pipelines.struct_T1 import T1_fast, T1_first, T1_sienax, T1_QC_COG
 from bip.pipelines.struct_T1 import T1_QC_CNR_corners, T1_QC_CNR_eyes
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py
index c9509a92139322ca3107a702d6213344dffc310b..5c80b1d277c81cde8e96c664115e4e9737a934ce 100755
--- a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_apply_bfc.py
@@ -14,7 +14,7 @@
 import os
 import logging
 from fsl import wrappers
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from pipe_tree import In, Out, Ref
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py
index 2264699a7fc75db2af59efe0d9c35d7f2888c812..a9a1aba48c16711523adb85e37c89c6e844c58db 100755
--- a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_brain_extract.py
@@ -12,7 +12,7 @@
 import logging
 from shutil import copyfile
 from fsl import wrappers
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 from pipe_tree import In, Out, Ref, update_closure
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py
index bd4d8ed7b21c7308aaf8721946f3a60892724a01..aa64af2806a7a8fce0076d98a095266026191f4c 100755
--- a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_defacing.py
@@ -15,7 +15,7 @@ import logging
 from shutil import copyfile
 from fsl import wrappers
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging, tempdir
+from bip.utils.log_utils import redirect_logging, tempdir
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py
index b3f00d77a95f86744aac23aba757f9306fda1637..d772bd1ca1db6495aa20ce5dfc2a5edfc1081338 100755
--- a/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py
+++ b/bip/pipelines/struct_T2_FLAIR/T2_FLAIR_gdc.py
@@ -13,7 +13,7 @@
 import logging
 from shutil import copyfile
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py b/bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py
index 2c08a118a9eb052368e03bbd00b203d75bfc2a5b..b052870b9419ae402f480f356333f9a39bc5a014 100755
--- a/bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py
+++ b/bip/pipelines/struct_T2_FLAIR/struct_T2_FLAIR.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils           import redirect_logging
 from bip.pipelines.struct_T2_FLAIR import T2_FLAIR_gdc, T2_FLAIR_brain_extract
 from bip.pipelines.struct_T2_FLAIR import T2_FLAIR_defacing, T2_FLAIR_apply_bfc
 
diff --git a/bip/pipelines/struct_asl/asl_get_IDPs.py b/bip/pipelines/struct_asl/asl_get_IDPs.py
index 4d19117d079591231a7f9e948007fb80737f9920..361e25017f6754cd8e562077c94bb21f1384487b 100755
--- a/bip/pipelines/struct_asl/asl_get_IDPs.py
+++ b/bip/pipelines/struct_asl/asl_get_IDPs.py
@@ -12,7 +12,7 @@
 
 import logging
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_asl/asl_proc.py b/bip/pipelines/struct_asl/asl_proc.py
index 864629e8571328b6bc0acf5eb334fe0f28f1b15c..c6eebed9d632db558302a8f1dee2346d7dcffeef 100755
--- a/bip/pipelines/struct_asl/asl_proc.py
+++ b/bip/pipelines/struct_asl/asl_proc.py
@@ -17,8 +17,8 @@ from shutil import copyfile
 from fsl import wrappers
 from pipe_tree import In, Out, Ref
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
-from bip.utils import redirect_logging
-from bip.commands.read_json_field import read_json_field
+from bip.utils.log_utils       import redirect_logging
+from bip.utils.read_json_field import read_json_field
 
 log = logging.getLogger(__name__)
 
diff --git a/bip/pipelines/struct_asl/struct_asl.py b/bip/pipelines/struct_asl/struct_asl.py
index 2a591ae528fab9f2bda6736293689759828f3c5f..9814e7d5110e7e737c0d520b17a2291620ba88d2 100755
--- a/bip/pipelines/struct_asl/struct_asl.py
+++ b/bip/pipelines/struct_asl/struct_asl.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils      import redirect_logging
 from bip.pipelines.struct_asl import asl_proc, asl_get_IDPs
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_swMRI/struct_swMRI.py b/bip/pipelines/struct_swMRI/struct_swMRI.py
index 6bb4c65a7b9b1abbe735acfef2112d57ed471d1b..60af5bdbe8056793dab89892128e1113bfebe0b6 100755
--- a/bip/pipelines/struct_swMRI/struct_swMRI.py
+++ b/bip/pipelines/struct_swMRI/struct_swMRI.py
@@ -10,7 +10,7 @@
 #
 
 import logging
-from bip.utils import redirect_logging
+from bip.utils.log_utils        import redirect_logging
 from bip.pipelines.struct_swMRI import swMRI_proc
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_swMRI/swMRI_gdc.py b/bip/pipelines/struct_swMRI/swMRI_gdc.py
index d9c2880128aceadf29fff6006bf427d96cecd0d8..00aee31304f19da9d5173aa894e3066dcf16dc03 100755
--- a/bip/pipelines/struct_swMRI/swMRI_gdc.py
+++ b/bip/pipelines/struct_swMRI/swMRI_gdc.py
@@ -12,7 +12,7 @@
 import logging
 from shutil import copyfile
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
 
 log = logging.getLogger(__name__)
diff --git a/bip/pipelines/struct_swMRI/swMRI_proc.py b/bip/pipelines/struct_swMRI/swMRI_proc.py
index 86c5cd3c393e302ccac33a68a76b241a8129dc77..5469cb4386a14428dec3fd91dc574a6dcdc92595 100755
--- a/bip/pipelines/struct_swMRI/swMRI_proc.py
+++ b/bip/pipelines/struct_swMRI/swMRI_proc.py
@@ -15,7 +15,7 @@ import logging
 from shutil import copyfile
 from fsl import wrappers
 from pipe_tree import In, Out, Ref
-from bip.utils import redirect_logging
+from bip.utils.log_utils import redirect_logging
 from bip.pipelines.struct_swMRI.swMRI_proc_fnc import combine_magnitude_coils
 from bip.pipelines.struct_swMRI.swMRI_proc_fnc import gen_filtered_phase
 from gradunwarp.core.gradient_unwarp_apply import gradient_unwarp_apply
diff --git a/bip/pipelines/struct_swMRI/swMRI_proc_fnc.py b/bip/pipelines/struct_swMRI/swMRI_proc_fnc.py
index 5a1163e680fbfe7440dbdeca708e51c5ee4d083e..17afae1bf3c6ee05f6b7a56026693e88ac9077c8 100755
--- a/bip/pipelines/struct_swMRI/swMRI_proc_fnc.py
+++ b/bip/pipelines/struct_swMRI/swMRI_proc_fnc.py
@@ -14,7 +14,7 @@ import nibabel as nib
 from fsl import wrappers
 import numpy as np
 import numpy.fft as ft
-from bip.commands.read_json_field import read_json_field
+from bip.utils.read_json_field import read_json_field
 
 def combine_magnitude_coils(MAG_TE1, MAG_TE2, MAG_TE1_dir, MAG_TE2_dir,
                             num_coils, SOS_TE1, SOS_TE2, SOS_ratio, R2star,
diff --git a/bip/commands/__init__.py b/bip/utils/__init__.py
similarity index 100%
rename from bip/commands/__init__.py
rename to bip/utils/__init__.py
diff --git a/bip/commands/get_b0s.py b/bip/utils/get_b0s.py
similarity index 100%
rename from bip/commands/get_b0s.py
rename to bip/utils/get_b0s.py
diff --git a/bip/commands/get_dwell_time.py b/bip/utils/get_dwell_time.py
similarity index 89%
rename from bip/commands/get_dwell_time.py
rename to bip/utils/get_dwell_time.py
index 5085da0934beab0c3f173fea203525d0a190de7c..339494a98353614c6e26c7ff800d1c1a88955a0d 100755
--- a/bip/commands/get_dwell_time.py
+++ b/bip/utils/get_dwell_time.py
@@ -1,8 +1,8 @@
 import os
 import nibabel as nib
-from bip.commands.read_json_field import read_json_field
+from bip.utils.read_json_field import read_json_field
 
-def get_dt(img, json):
+def get_dwell_time(img, json):
     if os.path.exists(json):
         t = read_json_field(fileName=json, fieldName="EffectiveEchoSpacing",
                             rounding=4,  multFactor=1000)
diff --git a/bip/utils.py b/bip/utils/log_utils.py
similarity index 100%
rename from bip/utils.py
rename to bip/utils/log_utils.py
diff --git a/bip/commands/read_json_field.py b/bip/utils/read_json_field.py
similarity index 100%
rename from bip/commands/read_json_field.py
rename to bip/utils/read_json_field.py