diff --git a/openstack_eosc.ipynb b/openstack_eosc.ipynb
index 155108a89076295d8396cd3050f1427555b7f164..3e7de153c7fcf386db7e743b2f79bc0466352ff1 100644
--- a/openstack_eosc.ipynb
+++ b/openstack_eosc.ipynb
@@ -1,27 +1,5 @@
 {
  "cells": [
-  {
-   "cell_type": "markdown",
-   "id": "f1d44b71-9709-467e-92d4-c1faa31a93e7",
-   "metadata": {
-    "jp-MarkdownHeadingCollapsed": true
-   },
-   "source": [
-    "# Deploying Your First Virtual Machine on PSNC OpenStack\n",
-    "\n",
-    "Welcome to this hands-on tutorial for launching and configuring your first Virtual Machine (VM) in the PSNC OpenStack cloud environment. This guide will walk you through each step of the deployment process—from authentication to full VM provisioning and access.\n",
-    "\n",
-    "📚 **Further reading:** [PSNC OpenStack Virtual Machines](https://docs.psnc.pl/display/EOSCUserGuides/Virtual+Machines)\n"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "00e621e9-5493-45aa-8cea-dcbb14ab0df6",
-   "metadata": {},
-   "source": [
-    "# Install the required libraries"
-   ]
-  },
   {
    "cell_type": "code",
    "execution_count": 1,
@@ -162,29 +140,41 @@
     }
    ],
    "source": [
-    "pip install python-openstackclient python-keystoneclient ipywidgets paramiko"
+    "!pip install python-openstackclient python-keystoneclient ipywidgets paramiko"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 1,
+   "execution_count": 2,
    "id": "c3718348-c7df-44d3-9811-66b7fa7ec7fb",
    "metadata": {},
    "outputs": [],
    "source": [
+    "\"\"\"\n",
+    "Import the required libraries\n",
+    "\"\"\"\n",
+    "import time\n",
     "import sys\n",
     "import paramiko\n",
-    "import yaml\n",
     "from keystoneauth1.session import Session\n",
     "from keystoneauth1.identity.v3.oidc import OidcAccessToken\n",
-    "from keystoneauth1.identity.v3.application_credential import ApplicationCredential\n",
     "from keystoneclient.v3.client import Client\n",
     "from openstack.connection import Connection\n",
+    "from openstack.exceptions import SDKException\n",
     "import ipywidgets as widgets\n",
-    "import base64\n",
-    "import time\n",
-    "from IPython.display import display, clear_output, Markdown\n",
-    "from openstack.exceptions import ResourceNotFound, SDKException"
+    "from IPython.display import display, clear_output, Markdown"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "f1d44b71-9709-467e-92d4-c1faa31a93e7",
+   "metadata": {},
+   "source": [
+    "# Deploying Your First Virtual Machine on PSNC OpenStack\n",
+    "\n",
+    "Welcome to this hands-on tutorial for launching and configuring your first Virtual Machine (VM) in the PSNC OpenStack cloud environment. This guide will walk you through each step of the deployment process—from authentication to full VM provisioning and access.\n",
+    "\n",
+    "📚 **Further reading:** [PSNC OpenStack Virtual Machines](https://docs.psnc.pl/display/EOSCUserGuides/Virtual+Machines)\n"
    ]
   },
   {
@@ -211,7 +201,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
+   "execution_count": 11,
    "id": "5bc6fac0-c5fa-44a7-9d29-38ea5164e4bc",
    "metadata": {},
    "outputs": [],
@@ -219,9 +209,10 @@
     "def load_access_token(token_file_path=\"/var/run/secrets/oidc/access_token\"):\n",
     "    \"\"\"Reads access token from specified file\"\"\"\n",
     "    try:\n",
-    "        return open(token_file_path, \"r\").read()\n",
+    "        return open(token_file_path, \"r\", encoding='utf-8').read()\n",
     "    except IOError:\n",
     "        print(\"Reading from access token file failed.\", file=sys.stderr)\n",
+    "        return None\n",
     "\n",
     "cloud_creds = OidcAccessToken(auth_url=\"https://api.cloud.psnc.pl:5000/v3/\",\n",
     "                              identity_provider=\"aai.open-science-cloud.ec.europa.eu\",\n",
@@ -249,7 +240,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": 4,
    "id": "b871dc55-172a-43da-81d7-b7fa796a7c2c",
    "metadata": {},
    "outputs": [],
@@ -261,7 +252,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 5,
    "id": "9a58d8c5-7dcd-4549-9b10-0456ccd66b30",
    "metadata": {},
    "outputs": [
@@ -280,7 +271,7 @@
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "190f79eec3d64952a1941b37feeecd98",
+       "model_id": "70fe6759b6f843f5afe6aad18e66ea63",
        "version_major": 2,
        "version_minor": 0
       },
@@ -294,7 +285,7 @@
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "0935ef7d353949ec8c78bb3409af17f8",
+       "model_id": "f15d05ad5d514e10872107301d1a3af2",
        "version_major": 2,
        "version_minor": 0
       },
@@ -308,7 +299,7 @@
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "a0095b69890e4fca99fb7ba40b204a4e",
+       "model_id": "9bc77f482af849bba0e3ae82e4458c51",
        "version_major": 2,
        "version_minor": 0
       },
@@ -321,6 +312,10 @@
     }
    ],
    "source": [
+    "# pylint: disable=invalid-name, global-statement, unused-argument, protected-access\n",
+    "\n",
+    "scoped_cloud_session = None\n",
+    "scoped_openstack_connection = None\n",
     "clear_output(wait=True)  # Clear previous output first\n",
     "display(Markdown(\"## Scope to one of your projects you are entitled to access\"))\n",
     "\n",
@@ -331,13 +326,14 @@
     ")\n",
     "connect_button = widgets.Button(description=\"Connect to project\", button_style=\"success\")\n",
     "output = widgets.Output()\n",
-    "\n",
     "def on_connect_clicked(b):\n",
+    "    \"\"\"Handle click event to connect to the selected OpenStack project.\"\"\"\n",
     "    with output:\n",
     "        clear_output()\n",
     "        idx = project_dropdown.value\n",
     "        selected_project = my_projects[idx]\n",
-    "        print(f\"🔌 Connecting to project: {selected_project.name} (ID: {selected_project.id}, Domain: {selected_project.domain_id})\")\n",
+    "        print(f\"🔌 Connecting to project: {selected_project.name} (ID: {selected_project.id}, \\\n",
+    "                Domain: {selected_project.domain_id})\")\n",
     "        scoped_cloud_creds = OidcAccessToken(\n",
     "            auth_url=\"https://api.cloud.psnc.pl:5000/v3/\",\n",
     "            identity_provider=\"aai.open-science-cloud.ec.europa.eu\",\n",
@@ -358,7 +354,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
+   "execution_count": 7,
    "id": "7c50e961-b797-4e1c-a91b-e44487324c0c",
    "metadata": {},
    "outputs": [
@@ -366,12 +362,12 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Your current project id:  db6b4eb2d6fe454191e8d39b088564cd\n"
+      "Your current project id: db6b4eb2d6fe454191e8d39b088564cd\n"
      ]
     }
    ],
    "source": [
-    "print(\"Your current project id: \", scoped_openstack_connection.current_project_id) "
+    "print(\"Your current project id:\", scoped_openstack_connection.current_project_id)\n"
    ]
   },
   {
@@ -405,20 +401,20 @@
     }
    ],
    "source": [
-    "key_name = \"key\"\n",
-    "new_keypair = scoped_openstack_connection.create_keypair(key_name)\n",
+    "KEY_NAME = \"key\"\n",
+    "new_keypair = scoped_openstack_connection.create_keypair(KEY_NAME)\n",
     "#Generating key-pair using existing public key\n",
     "#scoped_openstack_connection.create_keypair(\"mykey2\", public_key=\"ssh-rsa ....\")\n",
     "\n",
     "#If you let OpenStack generate your key-pair you will need to save your\n",
     "#private and public keys for later use\n",
-    "with open(f\"{key_name}.pem\", \"w\") as priv_file:\n",
+    "with open(f\"{KEY_NAME}.pem\", \"w\", encoding=\"utf-8\") as priv_file:\n",
     "    priv_file.write(new_keypair.private_key)\n",
-    "    print(f\"Private key saved to {key_name}.pem\")\n",
+    "    print(f\"Private key saved to {KEY_NAME}.pem\")\n",
     "\n",
-    "with open(f\"{key_name}.pub\", \"w\") as pub_file:\n",
+    "with open(f\"{KEY_NAME}.pub\", \"w\", encoding=\"utf-8\") as pub_file:\n",
     "    pub_file.write(new_keypair.public_key)\n",
-    "    print(f\"Public key saved to {key_name}.pub\")"
+    "    print(f\"Public key saved to {KEY_NAME}.pub\")"
    ]
   },
   {
@@ -531,7 +527,7 @@
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "1ee722a7e3e5472d8af3d9037a8eaaa5",
+       "model_id": "be2f61573a6f4dc7b38090a376e893d9",
        "version_major": 2,
        "version_minor": 0
       },
@@ -557,7 +553,7 @@
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "5effa4322c8d48bd83cf2538e407246c",
+       "model_id": "6046a6f70f0c4922ae92bafd8f79fc1e",
        "version_major": 2,
        "version_minor": 0
       },
@@ -583,7 +579,7 @@
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "8597753cd65e4382b60bb254807df518",
+       "model_id": "6155860fd9da407f81c665af2f73a859",
        "version_major": 2,
        "version_minor": 0
       },
@@ -597,24 +593,27 @@
    ],
    "source": [
     "def format_size_gb(size_bytes):\n",
+    "    \"\"\"Convert a size in bytes to a human-readable string in GB.\"\"\"\n",
     "    return f\"{size_bytes / (1024 ** 3):.2f} GB\"\n",
     "\n",
     "def format_image_options(images):\n",
+    "    \"\"\"Format a list of image objects for display in a dropdown.\"\"\"\n",
     "    return [\n",
     "        f\"{image.name} (ID: {image.id}, Size: {format_size_gb(image.size)})\"\n",
     "        for image in images\n",
     "    ]\n",
     "\n",
     "def format_generic_options(resources, label_attr='name', id_attr='id'):\n",
+    "    \"\"\"Format a list of OpenStack resources into label (ID) format.\"\"\"\n",
     "    return [f\"{getattr(res, label_attr)} (ID: {getattr(res, id_attr)})\" for res in resources]\n",
-    "    \n",
-    "images = list(scoped_openstack_connection.compute.images())\n",
+    "\n",
+    "available_images = list(scoped_openstack_connection.compute.images())\n",
     "flavors = list(scoped_openstack_connection.compute.flavors())\n",
     "networks = list(scoped_openstack_connection.network.networks())\n",
     "\n",
     "display(Markdown(\"### Available Images\"))\n",
     "image_dropdown = widgets.Dropdown(\n",
-    "    options=format_image_options(images),\n",
+    "    options=format_image_options(available_images),\n",
     "    description='Image:',\n",
     "    layout=widgets.Layout(width='85%')\n",
     ")\n",
@@ -645,13 +644,17 @@
    "outputs": [],
    "source": [
     "def get_selected_name(dropdown_value):\n",
+    "    \"\"\"Extract the name part from a dropdown value string formatted as 'Name (ID: id)'.\"\"\"\n",
     "    return dropdown_value.split(\" (ID: \")[0]\n",
+    "\n",
     "def get_selected_id(dropdown_value):\n",
+    "    \"\"\"Extract the ID part from a dropdown value string formatted as 'Name (ID: id)'.\"\"\"\n",
     "    return dropdown_value.split(\" (ID: \")[1].split(\")\")[0]\n",
+    "\n",
     "selected_image = get_selected_name(image_dropdown.value)\n",
     "selected_flavor = get_selected_name(flavor_dropdown.value)\n",
     "selected_network = get_selected_name(network_dropdown.value)\n",
-    "selected_network_id = get_selected_id(network_dropdown.value)"
+    "selected_network_id = get_selected_id(network_dropdown.value)\n"
    ]
   },
   {
@@ -863,19 +866,19 @@
    "outputs": [],
    "source": [
     "# VM parameters\n",
-    "cloud_init_script = \"\"\"#!/bin/bash\n",
+    "CLOUD_INIT_SCRIPT = \"\"\"#!/bin/bash\n",
     "apt-get update\n",
     "apt-get upgrade -y\n",
     "apt-get install -y nginx\n",
     "echo 'Hello from my VM' > /var/www/html/index.html\n",
     "\"\"\"\n",
-    "vm_name = \"new_vm\"\n",
+    "VM_NAME = \"new_vm\"\n",
     "server = scoped_openstack_connection.create_server(\n",
-    "    name=vm_name,\n",
+    "    name=VM_NAME,\n",
     "    image=selected_image,\n",
     "    flavor=selected_flavor,\n",
     "    network=network,  # Use new private network\n",
-    "    userdata=cloud_init_script,\n",
+    "    userdata=CLOUD_INIT_SCRIPT,\n",
     "    key_name=\"key\",\n",
     "    volumes=[new_volume],\n",
     "    security_groups=[new_security_group.name]\n",
@@ -889,7 +892,7 @@
    "id": "915cde8d-f668-44a1-913d-24436a93e4d4",
    "metadata": {},
    "source": [
-    "> It will take some time for `cloud_init_script` to finish."
+    "> It will take some time for `CLOUD_INIT_SCRIPT` to finish."
    ]
   },
   {
@@ -1156,12 +1159,28 @@
     "# Detach router interface first\n",
     "scoped_openstack_connection.network.remove_interface_from_router(\n",
     "    router,\n",
-    "    subnet_id=subnet.id  \n",
+    "    subnet_id=subnet.id\n",
     ")\n",
     "scoped_openstack_connection.network.delete_router(router)\n",
     "scoped_openstack_connection.network.delete_security_group(new_security_group)\n",
     "scoped_openstack_connection.network.delete_network(network)"
    ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "189c00ae-378d-4647-8226-bb5e1e5e0c03",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "31a05bda-47a1-4d00-abe5-3514cff6a7cb",
+   "metadata": {},
+   "outputs": [],
+   "source": []
   }
  ],
  "metadata": {