Enhanced filter unused vars to iteratively remove