fix preservesPartitioning

refactor