Refactor downloading

I don't want to merge this until someone else has checked it out