Before Refactor
if(age < 60 && age >= 50){ salary = age*10 + 100; }else{ salary = age*5; }
After Refactor
if(isMidAge(age)){ salary = midAgeSalary(age); }else{ salary = nonMidAgeSalary(age); }
Benefits: You hightlight the
condiction and make it clear what you are branching on.