refactored hostutils