consolidate utility methods into utils.py (renamed from fileutils.py)