Merging Add/Edit functions