Delete functionality and cleanup