simplify switch-case