cleanup: refactor filter initialization