Changed path to template dir to a var and added creation for compile folder if doesn't exists
Added validation for template dir path exists