joins refactored