Re-implemented token-filtering using a visitor (instead of a transformer)