refactore code and add delete basket