Split by folders. Needs some fix for the last folder.