wrap optimizely in switch