Improve tags insertion