move common function from models/__init__.py to utils/__init__.py