Refactoring the percentage method. Thanks Irio