since the boolean is no longer part of the query this can be simplified to as simple single 'in' clause query.