Refactor statistics printing