Improvments to templates to generate relationships much more accurately.