refactor user model and user tests