Add historyAnalyzer factory to encapsulate history filter logic