some clean up in partition.py