Cleaning up some of the work queue code