More refactoring and added delete_rack()