client network setup refactoring