simplify join code