Move partitioning to a function