generalize the threadpool implementation and make it available on all
handlers