add plan change to plan page and some refactor