finally sort out the model side