Simpler and more efficient threadpool based implementation