Heterocyclic compounds separation