add replace conditional with polymorphism