Usually it's a good idea to move these complex where conditions into a scope on your model to give it a logical name and make future chaining easier.