Reformat code & improve tag print