Small refactor in UserResource to avoid code duplication