Function deduplicateNamedBlocks