cleanup theme switching code