cleaner handling of join keys