More minor refactoring for join code.