refactor host if no port is given