Refacotor edit page of pages