cleaned up app.py a bit