improved backup and restore