Moved Query filters to ON conditions in the joins