Splits distribution into proc_info and plan. Refacters some variables.