refactor edit page front-end