refactored core/models.py