Refactor the editing page