narrower scope for operating_mode
cleanup and bugfix for auto_update routine