Refactor HOST assignment