Reformat networking code