added templates, added multi-relationship extension