First draft of thread spawner