Factor `referral_query` and friends to `...Mixin`