match non-builtin collections by reference instead of element-wise