refactor tar archive generator