More analytics refactoring.