Factorizing the joins