refactor user model, user resource