Better filtering code.