Re-factor. Use ternary over verbose switch statement.

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