refactor the domain manager