Optimization of list filtering