refactoring of data analyser