refactor: move redirect to query filter.