refactor worker inproc so that it can be used for mif, pmcmc and simul