Dynamic token replacement - added more test when the template is external file