copy dir refactor