Refactor detection of to-address.