Purity with removing pairs and references