Update templates' contract hierarchy