Re-factored code for delete method of set module

I can take this line. Good eye.