refactor filter structure