optimized filter metho