foundation for restore functions
implemented restore logic, works for some plugins