s/assert/if/
factor download functions together into a generator