Refactor to allow multiple files per document