refactor a bit
get statistical values among events