Template file cleanup