refactored code to utilize isdual instead of generic comparisons