Replace setOperator by constructor that sets the root element for each constructor type