Refactor the Cytoscape network generation