When we want to refactor, we should always refactor by design patterns, knowing what we do …
I use to come back to the Martin Fowler RefactoringCatalog
We found that refactoring is an aggressive process which virtually hurts the keyboard exercising all the shortcuts of our IDE.
Specifying the substitution of conditionals
As Fowler says: “When you have a conditional that chooses between different behaviors depending on the type of an object” … That can be changed easily info classes.
There are other places to give more extensive explanations if you prefer:
Finally, I recommend checking out this great site where refactoring conditional is explained in a way… let’s say different.