Refactor according to the network spec.