some refactoring
extract histogram calculation as a util function
some more refactoring
add interactive stats chart, will be used as filter & etc.