add joinOnAs, move join logic to a private method