additional fix for 16485257 - isolate the ref generation only to cases where package mapping prevails