refactor filter initialization