Started refactoring graph json creation