Refactor out getDomainsOfUser