refactoring to set also d2d server