refactoring external domain management