improved insertTag functions