[refac] extract function
[impl] nested associativity for product