refactor delete cluster code to make it clean

Change-Id: I60264674d51151f70986182c8edac9314ce459f7