Refactor membership service.