Code cleanup for joins.