refactored analyser