diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
index 24d88ea5c7c842fa9a62f816bec34cb281723c10..cee0b0b02d89ae64d51f3206c9da3b9ffb954ab0 100644
--- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
+++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
@@ -81,11 +81,11 @@
     "from extra_data import RunDirectory, H5File\n",
     "from pathlib import Path\n",
     "\n",
+    "import cal_tools.restful_config as rest_cfg\n",
     "from calibration_client import CalibrationClient\n",
     "from cal_tools.calcat_interface import CalCatError, GOTTHARD2_CalibrationData\n",
     "from cal_tools.files import DataFile\n",
     "from cal_tools.gotthard2 import gotthard2algs, gotthard2lib\n",
-    "from cal_tools.restful_config import restful_config\n",
     "from cal_tools.step_timing import StepTimer\n",
     "from cal_tools.tools import (\n",
     "    calcat_creation_time,\n",
@@ -194,27 +194,6 @@
     "print(\"Single Photon:\", single_photon)"
    ]
   },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "b3613034",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "# Connect to CalCat.\n",
-    "calcat_config = restful_config['calcat']\n",
-    "client = CalibrationClient(\n",
-    "    base_api_url=calcat_config['base-api-url'],\n",
-    "    use_oauth2=calcat_config['use-oauth2'],\n",
-    "    client_id=calcat_config['user-id'],\n",
-    "    client_secret=calcat_config['user-secret'],\n",
-    "    user_email=calcat_config['user-email'],\n",
-    "    token_url=calcat_config['token-url'],\n",
-    "    refresh_url=calcat_config['refresh-url'],\n",
-    "    auth_url=calcat_config['auth-url'],\n",
-    "    scope='')"
-   ]
-  },
   {
    "cell_type": "markdown",
    "id": "8c852392-bb19-4c40-b2ce-3b787538a92d",
@@ -242,13 +221,14 @@
     "    acquisition_rate=acquisition_rate,\n",
     "    single_photon=single_photon,\n",
     "    event_at=creation_time,\n",
-    "    client=client,\n",
+    "    client=rest_cfg.calibration_client(),\n",
     ")\n",
     "# Keep as long as it is essential to correct\n",
     "# RAW data (FXE p003225) before the data mapping was added to CALCAT.\n",
     "try:  # in case local constants are used with old RAW data. This can be removed in the future.\n",
     "    for mod_info in g2_cal.physical_detector_units.values():\n",
     "        da_to_pdu[mod_info[\"karabo_da\"]] = mod_info[\"physical_name\"]\n",
+    "    db_modules = [da_to_pdu[da] for da in karabo_da]\n",
     "except CalCatError as e:\n",
     "    print(e)\n",
     "    db_modules = [None] * len(karabo_da)\n",
@@ -269,22 +249,12 @@
     "            const_data[mod] = dict()\n",
     "            for cname, mdata in const_yaml[mod][\"constants\"].items():\n",
     "                const_data[mod][cname] = dict()\n",
+    "                print(mdata)\n",
     "                if mdata[\"creation-time\"]:\n",
     "                    with h5py.File(mdata[\"path\"], \"r\") as cf:\n",
     "                        const_data[mod][cname] = np.copy(\n",
     "                            cf[f\"{mdata['dataset']}/data\"])\n",
     "    else:\n",
-    "        g2_cal = GOTTHARD2_CalibrationData(\n",
-    "            detector_name=karabo_id,\n",
-    "            sensor_bias_voltage=bias_voltage,\n",
-    "            exposure_time=exposure_time,\n",
-    "            exposure_period=exposure_period,\n",
-    "            acquisition_rate=acquisition_rate,\n",
-    "            single_photon=single_photon,\n",
-    "            event_at=creation_time,\n",
-    "            snapshot_at=creation_time,\n",
-    "        )\n",
-    "\n",
     "        mdata_dict = {\"constants\": dict()}\n",
     "\n",
     "        constant_names = [\"LUTGotthard2\", \"OffsetGotthard2\", \"BadPixelsDarkGotthard2\"]\n",
@@ -293,7 +263,7 @@
     "\n",
     "        # Retrieve metadata for all pnccd constants.\n",
     "\n",
-    "        g2_metadata = g2_cal.ndarray_map(constant_names)\n",
+    "        const_data = g2_cal.ndarray_map(constant_names)\n",
     "\n",
     "    # Validate the constants availability and raise/warn correspondingly.\n",
     "    for mod, calibrations in const_data.items():\n",
@@ -479,32 +449,6 @@
     "        mod_dcs[mod][\"train_raw_gain\"] = train_dict[\"data.gain\"]"
    ]
   },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "494b453a",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "# Keep as long as it is essential to correct\n",
-    "# RAW data (FXE p003225) before the data mapping was added to CALCAT.\n",
-    "try:\n",
-    "    db_modules = get_pdu_from_db(\n",
-    "        karabo_id=karabo_id,\n",
-    "        karabo_da=karabo_da,\n",
-    "        constant=Constants.jungfrau.Offset(),\n",
-    "        condition=condition,\n",
-    "        cal_db_interface=cal_db_interface,\n",
-    "        snapshot_at=creation_time,\n",
-    "    )\n",
-    "except RuntimeError:\n",
-    "    print(\n",
-    "        \"No Physical detector units found for this\"\n",
-    "        \" detector mapping at the RAW data creation time.\"\n",
-    "    )\n",
-    "    db_modules = [None] * len(karabo_da)"
-   ]
-  },
   {
    "cell_type": "code",
    "execution_count": null,
diff --git a/notebooks/Gotthard2/Gotthard2_retrieve_constants_precorrection_NBC.ipynb b/notebooks/Gotthard2/Gotthard2_retrieve_constants_precorrection_NBC.ipynb
index 6effefce988ee88fecffb4e8e25ca95e4e154ddf..3a50b46c76993bffd3f6450701564710b09ef88d 100644
--- a/notebooks/Gotthard2/Gotthard2_retrieve_constants_precorrection_NBC.ipynb
+++ b/notebooks/Gotthard2/Gotthard2_retrieve_constants_precorrection_NBC.ipynb
@@ -66,10 +66,10 @@
     "from extra_data import RunDirectory\n",
     "from pathlib import Path\n",
     "\n",
+    "import cal_tools.restful_config as rest_cfg\n",
     "from calibration_client import CalibrationClient\n",
     "from cal_tools.calcat_interface import GOTTHARD2_CalibrationData\n",
     "from cal_tools.gotthard2 import gotthard2lib\n",
-    "from cal_tools.restful_config import restful_config\n",
     "from cal_tools.tools import (\n",
     "    calcat_creation_time,\n",
     "    get_from_db,\n",
@@ -132,26 +132,6 @@
     "print(\"Single Photon:\", single_photon)"
    ]
   },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "# Connect to CalCat.\n",
-    "calcat_config = restful_config['calcat']\n",
-    "client = CalibrationClient(\n",
-    "    base_api_url=calcat_config['base-api-url'],\n",
-    "    use_oauth2=calcat_config['use-oauth2'],\n",
-    "    client_id=calcat_config['user-id'],\n",
-    "    client_secret=calcat_config['user-secret'],\n",
-    "    user_email=calcat_config['user-email'],\n",
-    "    token_url=calcat_config['token-url'],\n",
-    "    refresh_url=calcat_config['refresh-url'],\n",
-    "    auth_url=calcat_config['auth-url'],\n",
-    "    scope='')"
-   ]
-  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -166,8 +146,7 @@
     "    acquisition_rate=acquisition_rate,\n",
     "    single_photon=single_photon,\n",
     "    event_at=creation_time,\n",
-    "    snapshot_at=creation_time,\n",
-    "    client=client,\n",
+    "    client=rest_cfg.calibration_client(),\n",
     ")\n",
     "\n",
     "mdata_dict = {\"constants\": dict()}\n",