Optimized the fetching of degree and betweenness