refactor to extract analyzer