refactored netServer into NodeServer struct with dependency injectino