Updated quality logic