Refactor Neighbor Pairing