extracts domain, realm into another class