Move statistics retrieve and transformation to service.