sieve refactor