refactor filter util