Make the flask app more pythonic