[#57] Cleaned up and moved thread management to ThreadService.