Re-commit r223330: Rewrite InputGraph's Group