refactored edit page