More multihost support and cleanup [skip ci]