add "templateDir" support