Re-factor. Use ternary over verbose switch statement.

This change is brought to you by Sam Eaton and number 42.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>