my $theme = ( ( $global_config->{modes}{$current_mode}{theme} // $theme_config->{current_theme} ) // $default_theme ) // 'none';