update ui helper to take optional domain.