Minor simplification to compareByScope