tidy up and refactoring of theme setup in preparation for 1.2 release