Refactor
UnitTest for isPair