More deduplication of logic