Pull this into the constructor of the thread. Makes this code shorter so it can focus on its real task: transferring stuff.