Better (more generic) method for deciding host