improve hosts generation
drop whitespace