Extracted canonicalizer into an external module.