Filtering refactor and IN operator implementation