Refactored the editing and update