Refactored analytic helper and enabled pie charts