refactored import/export and graphs