Factor out parser filtering and ranking.