minor improvement (removed useless lines of code and used del_if_handle function).