reorganize the plan c solver code