Refactoring get domain method