implemented polymorphic element instantiation