create_new_plan.php  refactoring (not finished)