refactor(dom) processFiles