Write template
Remove old file from tree