moved logic to the model. P 166