changing app.py for refactor