GetDomain function moved from db_helper to helper module