Fixed thread leaks, added custom thread factory