Graph cleanup