Separated bag restore logic from executable