Refactor product duplication.

Fixes #2641