replace conditional with polymorphism
replace conditional with polymorphism