Refactor the theme layout