@classmethod
def patch_ports(cls, pair):
    """Wrap ports with int or use None."""
    if pair[0] in ('remote_port', 'local_port'):
        return pair[0], pair[1] and int(pair[1]) or None
    return pair
