Added logic to render template to a target directory