Refactor pending memberships