move some more logic to the model