Extracted networking code out into service