merge statistics refactoring