Improved QueryCondition mechanism.