Improved / cleaned segmentation of AND/OR in where/having