set up template inheritance