Improve comments and add checking $theme type.