refactoring statistics class