Added template conditionals