refactoring the analyzer