PDIO-21 #comment add ThresholdUserBased and factor out common code