Restructures directories to put similar blocks together.