Improve output logging in models.py