Refactor Part of the network persistence code.