Refactor filter system