refactoring user model