generate template using thor rather than handcrafted