Refactored handling of default theme when the current theme is removed