Add thrift mode and handlebars mode