Change the logic of the model

Now the model take all required parameters inside the constructor.