Migrate log/page select logic in clatch.py to helper functions in models.py