Refactor Threadpool class

Part of #4 issue.
That's a good idea. But, I would do it in another ticket.