Refine code to add Modify and delete functionality