Move the setting & clearing of worker state change requests into separate functions. No functional changes.