main domain check refactoring