refactor membership provider to repo