Move package handling to new function.
Transmission retry until success.