optimize insert handler for doc tag