refactor the model service