refact: if...elsifをcase文に置き換え