Working on delete button and refactor for factory