avoid unnecessary shallow copies. The change rippled through a lot of code.
Doing this in multiple commits in an attempt to preserve the file movement history.