ensure-pairs refactored to use now public ensure-pair