refactor total statistics

refactoring of objects, calculation and presentation of
total statistics
may work bad. pushed only to prevent from conflicts