some refactoring, wip regarding save