refactoring to eject gc code from ZRestore and make world a bit better place

Signed-off-by: Gleb Golubitsky <sectoid@gnolltech.org>