Refactor the damage graph.