Added helpers (refactored app.py to use)