Revert "removed an unnecessary copy of objects when loading data from source files in memory mode"

This reverts commit 7fdaa1fc46226b9c81d95cd6572a15e41760f98d.