Membership fixes; refactoring common code.