Moved clean graphs to own function