better filtering for uniquifying