Merge "Refactor NetworkFactory."