recursive templates