optimise for not only contains queries