Refactor statistics.