Refactoring. File stuff moved out into own Factories.