Clean up code; de-duplicate nodes.