Move thread creation into "correct" location