diff --git a/src/web_server/main.py b/src/web_server/main.py
index 271b1b2..34a83f5 100644
--- a/src/web_server/main.py
+++ b/src/web_server/main.py
@@ -1,4 +1,3 @@
-
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,29 +12,34 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from xosconfig import Config
-from multistructlog import create_logger
-log = create_logger(Config().get('logging'))
+from __future__ import absolute_import, print_function
 
-from grpc_client.main import GRPC_Client
-from klein import Klein
-import os
-from tosca.parser import TOSCA_Parser
-from tosca.default import TOSCA_DEFS_DIR
 import json
+import os
 
-BANNER = """
-   _  ______  _____    __________  _____ _________ 
+from grpc_client import GRPC_Client
+from klein import Klein
+from multistructlog import create_logger
+from tosca.default import TOSCA_DEFS_DIR
+from tosca.parser import TOSCA_Parser
+from xosconfig import Config
+
+log = create_logger(Config().get("logging"))
+
+
+BANNER = r"""
+   _  ______  _____    __________  _____ _________
   | |/ / __ \/ ___/   /_  __/ __ \/ ___// ____/   |
   |   / / / /\__ \     / / / / / /\__ \/ /   / /| |
  /   / /_/ /___/ /    / / / /_/ /___/ / /___/ ___ |
 /_/|_\____//____/    /_/  \____//____/\____/_/  |_|
 """
 
+
 class TOSCA_WebServer:
 
     current_dir = os.path.dirname(os.path.realpath(__file__))
-    template_dir = os.path.join(current_dir, 'templates/')
+    template_dir = os.path.join(current_dir, "templates/")
 
     app = Klein()
 
@@ -59,48 +63,43 @@
             log.info("[XOS-TOSCA] Fatal Error: \n\n", failure=failure)
             return "Internal server error, please report this along with the failed recipe."
 
-    @app.route('/', methods=['GET'])
+    @app.route("/", methods=["GET"])
     def index(self, request):
         request.responseHeaders.addRawHeader(b"content-type", b"application/json")
-        tosca_defs = [f for f in os.listdir(TOSCA_DEFS_DIR) if not f.startswith('.')]
+        tosca_defs = [f for f in os.listdir(TOSCA_DEFS_DIR) if not f.startswith(".")]
 
         response = {}
         for d in tosca_defs:
-            name = d.replace('.yaml', '')
+            name = d.replace(".yaml", "")
             response[name] = "/custom_type/%s" % name
         return json.dumps(response)
 
     @app.route("/custom_type/<name>")
     def custom_type(self, request, name):
         request.responseHeaders.addRawHeader(b"content-type", b"text/plain")
-        custom_type = open(TOSCA_DEFS_DIR + '/' + name + '.yaml').read()
+        custom_type = open(TOSCA_DEFS_DIR + "/" + name + ".yaml").read()
         return custom_type
 
-    @app.route('/run', methods=['POST'])
+    @app.route("/run", methods=["POST"])
     def run(self, request):
-        recipe = request.content.read()
-        headers = request.getAllHeaders()
-        username = headers['xos-username']
-        password = headers['xos-password']
+        return self._handle_post(request, delete=False)
 
-        parser = TOSCA_Parser(recipe, username, password)
-        d = GRPC_Client().create_secure_client(username, password, parser)
-        tosca_execution = d.addCallback(self.execute_tosca)
-        tosca_execution.addErrback(self.errorCallback, request)
-        return d
-
-    @app.route('/delete', methods=['POST'])
+    @app.route("/delete", methods=["POST"])
     def delete(self, request):
-        recipe = request.content.read()
-        headers = request.getAllHeaders()
-        username = headers['xos-username']
-        password = headers['xos-password']
+        return self._handle_post(request, delete=True)
 
-        parser = TOSCA_Parser(recipe, username, password, delete=True)
+    def _handle_post(self, request, delete=False):
+
+        headers = request.getAllHeaders()
+        username = headers["xos-username"]
+        password = headers["xos-password"]
+        recipe = request.content.read()
+
+        parser = TOSCA_Parser(recipe, username, password, delete=delete)
         d = GRPC_Client().create_secure_client(username, password, parser)
         tosca_execution = d.addCallback(self.execute_tosca)
         tosca_execution.addErrback(self.errorCallback, request)
         return d
 
     def __init__(self):
-        self.app.run('0.0.0.0', '9102')
\ No newline at end of file
+        self.app.run("0.0.0.0", "9102")
