minor refactoring in dualstack()