Refactoring: cartesian product works