update controller to make template folder configurable