MAJOR REFACTOR - refactored everything involving local saving - tests
need to be fixed