-So the resulting code will be like this. As you can see here, - -2
-now I don't have the conditionals any longer, but I just have a call to - -3
-this notEligibleForDisability method. And this makes the code so - -4
-much clearer, because if I just need to understand how disabilityAmount works, - -5
-I can clearly see there is an initial check that is actually checking whether - -6
-an employee's eligible for disabilities or not. And if the check is false, so - -7
-if the employee's eligible, then I'll just perform the rest of the computation. - -8
-Otherwise I'll simply return zero. - -9
-So if I don't need to understand the details of this check, - -10
-I can simply look at this method and understand it all. And if I need to look at - -11
-the details I can just go, and look at the implementation of this method, - -12
-and I will get exactly the same information that I have here. But I'm sort of - -13
-separating the concerns, and making the code overall more understandable, and - -14
-therefore more maintainable, which is the main goal of refactoring. -- cgit 1.4.1