adding statistic widget, a lot of refactoring