moved process logic to use PoolContext