Refactor construction of idm user from relay user.