inline toggleFeature function