The pairwise logic appears in multiple points, we should unify it in the future