file IO stub, minor refactoring