Minor code quality improvement

Use case instead of if
Merge pull request #1 from nmeum/06e385a8be06b611f70d94b4adb4d326036f3ef2

Minor code quality improvement