Revert "Add delete logic and optimized code"

This reverts commit 11b5ff27a80863b2e9050cd769fbeb94cc229be6.