simplify 'isCollection' logic