Refactored creation of delete button