refactor tof the model