Refactored the disk detachment check loop and updated few comments.