remove all extra lines from templates