Analytics module enhancements, slight global refactor