Refactored the way repo directories are deleted