Fix theme switching bug
Separated httphandler and settings generation