refactored analyzer to use map-reduce api