small re-factory on graph components, improve sampling tools