Refactor Analyzer to return Analysis