I would be very tempted once the other changes above are done to
a) inline addPrefix (it is now only 2 or 3 lines)
b) inline publishHeaders (now only 2 lines)
c) move partitionWork from a member variable to a local variable in this function.  (Now you can remove the kill() call from the inlined publish headers)