Break get_quality into two functions to avoid pointers
Merge commit 'baff45b1ddc215d5965a8c759129d58daf41713d'