Refactoring to properly handle different file types on Cytoscape load