Improved the folder merging