Refactored yz_cover:calc_plan for readability.