refactory users model