master: more refactoring and statistics output of results