Remove unnecessary codes and modify the statistics-related