Refactor hash add/edit/delete