Smarter configuration for webclient, served by the hub. Also did some code cleanup.