graph cleanup