partition refactor