removes redundant enclosing tag