Added some more logic to the models.