replace group by element substructure