Reusable functions moved to functions.py