Refactored updateQuality