add calc_statistics & optimize access to redis