diff --git a/test/download_test.py b/test/download_test.py
index ab5f9b11402127472aa1c8989e65b79622b183ec..5c84a86d2e20572887c0eb4ab975632a7bece915 100644
--- a/test/download_test.py
+++ b/test/download_test.py
@@ -13,7 +13,7 @@ parser.add_argument("--day", type=int, default=1)
 params = parser.parse_args()
 
 # Get all scenes in the root_dir
-_, _, bbox = utils.get_epsg_extent_bbox(params.refimage)
+bbox = utils.get_bbox_wgs84_from_raster(params.refimage)
 acq_date = datetime.datetime(year=params.year, month=params.month, day=params.day)
 downloader = TheiaDownloader(config_file=params.theia_cfg)
 downloader.download_closest(bbox_wgs84=bbox, acq_date=acq_date, download_dir=params.download_dir)
diff --git a/test/drs_search.py b/test/drs_search.py
index 94febe5b0c89b53efb3284d08b93e5e4e4c554fa..eb11015ef2bdab4c4e0b6d807a5afd44b1fecaff 100644
--- a/test/drs_search.py
+++ b/test/drs_search.py
@@ -1,5 +1,4 @@
 import argparse
-import gdal
 from scenes import utils, Index
 
 # Arguments
@@ -17,12 +16,9 @@ idx = Index(scenes)
 
 # search
 print("search roi")
-if params.roi.lower().endswith(".tif"):
-    gdal_ds = gdal.Open(params.roi)
-    bbox = utils.get_bbox_wgs84_from_gdal_ds(gdal_ds=gdal_ds)
-else:
-    bbox = utils.get_bbox_wgs84_from_vector(params.roi)
-matches = idx.find(bbox_wgs84=bbox)
+bbox_fn = utils.get_bbox_wgs84_from_raster if params.roi.lower().endswith(".tif") \
+    else utils.get_bbox_wgs84_from_vector
+matches = idx.find(bbox_wgs84=bbox_fn(params.roi))
 print("{} scenes found.".format(len(matches)))
 #for scene_match in matches:
 #    print(scene_match)
diff --git a/test/drs_stack.py b/test/drs_stack.py
index 7901aa1d521447968a9389ec5ebd20e8e6e9f5f7..7deaaba3aa2a0beda3497aaaaaf1fa2f90029b7d 100644
--- a/test/drs_stack.py
+++ b/test/drs_stack.py
@@ -1,5 +1,4 @@
 import argparse
-import gdal
 import pyotb
 from scenes import utils, Index
 from scenes.spot import get_spot67_scenes
@@ -20,8 +19,7 @@ idx = Index(scenes)
 
 # search
 print("search roi")
-gdal_ds = gdal.Open(params.roi)
-bbox = utils.get_extent_wgs84(gdal_ds)
+bbox = utils.get_bbox_wgs84_from_raster(params.roi)
 matches = idx.find(bbox_wgs84=bbox)
 print("{} scenes found.".format(len(matches)))