refactoring putting stuff to the model