move register and graph to namespace method