restructure the home loop