Polymorphic refactory