Improve the `withHost` method implementation