Replace Conditional with Polymorphism