StatGraph: rename some variable and clean up code