Refactoring JSFileIO