This is good, but we should prefer 'global $theme;' at topic of the method.