Optimize collection building
Do some optimizations