cleanup keygraph source code