切り替え反応もいきなり独立した関数で書く

関連:Tips/Directly write choices as independent functions