Extracted networking & signalhandling to own files