Refactor 10-lines switch into ternary if.

Also remove dangling tab line before.