added support for the maxFacets argument