getting rid of thread creation