Refactor network layer.