Remove joins and leaves