Removal of useless files and merging files