only generate subfolders when needed