reorganized and commented the user model