Generalize the QualityFactor into its own trait