refactor: move regression tree partition code to partition