EZP-23129: simplify join code