File refactor

this isn't done yet -- unit tests to be added