diff --git a/1.Base/1.Utilities/0_setup.py b/1.Base/1.Utilities/0_setup.py
index bdf169c97b97ab0c087dc0c351be97259ff5f043..1a512952af87ccd1d5e73151a1f572491469efa2 100644
--- a/1.Base/1.Utilities/0_setup.py
+++ b/1.Base/1.Utilities/0_setup.py
@@ -1,22 +1,44 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
+
 import utils
 
+packages = [
+    "bmon",
+    "curl",
+    "git",
+    "host",
+    "htop",
+    "iotop",
+    "ipython3",
+    "lm-sensors",
+    "make",
+    "net-tools",
+    "netcat",
+    "nfs-client",
+    "pciutils",
+    "pwgen",
+    "python3-openssl",
+    "python3-requests",
+    "python3-spf",
+    "smartmontools",
+    "vim",
+]
+
 
 def setup(interactive=True):
     dir_path = utils.get_dir(__file__)
     cmds = [
-        'apt-get clean',
-        'apt-get update',
-        'apt-get install --yes make ipython3 vim netcat git htop iotop bmon net-tools host lm-sensors pciutils nfs-client smartmontools pwgen curl python3-requests',
+        "apt-get clean",
+        "apt-get update",
+        "apt-get install --yes {}".format(" ".join(packages)),
         # Locale
-        'locale-gen en_GB.UTF-8',
-        'update-locale LANG=en_GB.UTF-8 LANGUAGE=en_GB.UTF-8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8',
+        "locale-gen en_GB.UTF-8",
+        "update-locale LANG=en_GB.UTF-8 LANGUAGE=en_GB.UTF-8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8",
         # Copy vimrc file
-        'cp "%s/vimrc" "/root/.vimrc"' % dir_path,
+        "cp '{}/vimrc' /root/.vimrc".format(dir_path),
         # Copy bashrc file
-        'cp "%s/bashrc" "/root/.bashrc"' % dir_path,
+        "cp '{}/bashrc' /root/.bashrc".format(dir_path),
         # Generate SSH key if not already done
-        '[ -f /root/.ssh/id_rsa ] || ssh-keygen -b 4096 -t rsa -f /root/.ssh/id_rsa -P ""',
+        "[ -f /root/.ssh/id_rsa ] || ssh-keygen -b 4096 -t rsa -f /root/.ssh/id_rsa -P ''",
     ]
     utils.run_commands(cmds)
diff --git a/tests/test_email.py b/tests/test_email.py
index 35d3e258a969aa39c188cc8b2d8c8ccd27f17476..a934d3f79f00b6370ba22b014edc9668f1ca884c 100755
--- a/tests/test_email.py
+++ b/tests/test_email.py
@@ -5,23 +5,14 @@ Criticality: High
 Checks that emails can be sent.
 """
 
-from pathlib import Path
 import os
+from pathlib import Path
+import random
 import subprocess
 import sys
-import random
 import time
 
-# install spf lib if not present
-try:
-    import spf
-except ImportError:
-    subprocess.check_call(["apt-get", "-qq", "-y", "install", "python3-spf"])
-    import spf
-
-# install netstat if not present
-if subprocess.call(["which", "netstat"], stdout=subprocess.DEVNULL) != 0:
-    subprocess.check_call(["apt-get", "-qq", "-y", "install", "net-tools"])
+import spf
 
 sys.path.append(str(Path(__file__).parents[1].resolve()))