Eliminating not valid relationships