Refactor filter application