Added support for templates
Changed template folder to data dir