refactor the folder making codes