Cleaning up the worker role logic.