beautify the template