template file cleanup