replace union & lists with set operations where appropriate