Ip check refact.