Properly generate directory structure