Factor out node and edge centrality methods