revert cleanups in setup_work function