refactored customer and analytics model