minor refactoring of the duplex guard