added a model and removed the data out of the controller