Refactoring for testing network.