Added changes for template-file option

Code cleanup related to template file option.