First refactoring to implement Map-Reduce analyzer