partitioning refactoring