Refactored util functions into util.py & using app.config for globals