create_new_plan.php refactoring (finished)