Removed duplication for writeWhereIns and writeWhereNotIns methods