added set users support
modularized getting primaryHost