TC: preliminary structure for on-the-fly template creation

In progress...