Can this section of code that deletes the deck folder be factored out into a separate function? This would be better since we could then test that function in isolation and also call it from other places.