delete extra lines from template