Refactor user repository