Change has_set to return an option with the found pair