I see that case statement will be more suitable here, but why this pull request should contain this fix. For this purpose would be better to have separated commit