refactored code for setting the theme of website