some refactoring for better clean data, i.e. variable names are renamed. first steps in result creation