add option for explicit instead of automatic saving; refactor