add statistic view and refactor