Main graph cleanup