Refactored pattern for obtaining a valid Piwik instance