Better way to handle nested filters