refactoring models.py