re-implement UI._templateInstance()