Refactored getClassFromPercent