fixed rubocop complexity switch statement