Refactoring for ThemeCompiler