Refactoring in preparation for supporting another analytics service.