Separated most functions into standalone module (forage_utils.py)