refactor networking code and send version number