Refactor statistics class. See: #45