refactored joins class