add restore, some refactoring in settings