Canonicalize collections in builder pattern part1

Improves code quality as well as performance. @andreistefanescu @dwightguth please review