separted the loader from the main graph code