factored out instance recovery to its own module