Improve tag construction code for displaying