More refactoring and code simplification

in outcome_products_random.