refactor views and add delete button