Move all registry state variables to loop() local vars.