Removed unnecessary data from templates, modified the canonicalizing method in some cases.